/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  
  checkConfig(config);
  @endpoint = getEndpoint('oos', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AnalyzeGitRepositoryRequest {
  branch?: string(name='Branch'),
  clientToken?: string(name='ClientToken'),
  orgId?: string(name='OrgId'),
  owner?: string(name='Owner', description='This parameter is required.'),
  platform?: string(name='Platform', description='This parameter is required.'),
  regionId?: string(name='RegionId'),
  repoFullName?: string(name='RepoFullName'),
  repoId?: string(name='RepoId'),
}

model AnalyzeGitRepositoryResponseBody = {
  analysisResults?: [ 
    {
      buildFiles?: [ 
        {
          fileType?: string(name='FileType'),
          paths?: [ string ](name='Paths'),
        }
      ](name='BuildFiles'),
      buildType?: string(name='BuildType'),
      runtimeType?: string(name='RuntimeType'),
    }
  ](name='AnalysisResults'),
  count?: int32(name='Count'),
  requestId?: string(name='RequestId'),
}

model AnalyzeGitRepositoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AnalyzeGitRepositoryResponseBody(name='body'),
}

/**
 * @summary 分析仓库
 *
 * @param request AnalyzeGitRepositoryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AnalyzeGitRepositoryResponse
 */
async function analyzeGitRepositoryWithOptions(request: AnalyzeGitRepositoryRequest, runtime: Util.RuntimeOptions): AnalyzeGitRepositoryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.branch)) {
    query['Branch'] = request.branch;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.orgId)) {
    query['OrgId'] = request.orgId;
  }
  if (!Util.isUnset(request.owner)) {
    query['Owner'] = request.owner;
  }
  if (!Util.isUnset(request.platform)) {
    query['Platform'] = request.platform;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.repoFullName)) {
    query['RepoFullName'] = request.repoFullName;
  }
  if (!Util.isUnset(request.repoId)) {
    query['RepoId'] = request.repoId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AnalyzeGitRepository',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 分析仓库
 *
 * @param request AnalyzeGitRepositoryRequest
 * @return AnalyzeGitRepositoryResponse
 */
async function analyzeGitRepository(request: AnalyzeGitRepositoryRequest): AnalyzeGitRepositoryResponse {
  var runtime = new Util.RuntimeOptions{};
  return analyzeGitRepositoryWithOptions(request, runtime);
}

model CancelExecutionRequest {
  executionId?: string(name='ExecutionId', description='The ID of the execution.

This parameter is required.', example='exec-xxx'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
}

model CancelExecutionResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='14A07460-EBE7-47CA-9757-12CC4761D47A'),
}

model CancelExecutionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CancelExecutionResponseBody(name='body'),
}

/**
 * @summary Cancels an execution.
 *
 * @param request CancelExecutionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CancelExecutionResponse
 */
async function cancelExecutionWithOptions(request: CancelExecutionRequest, runtime: Util.RuntimeOptions): CancelExecutionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.executionId)) {
    query['ExecutionId'] = request.executionId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CancelExecution',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Cancels an execution.
 *
 * @param request CancelExecutionRequest
 * @return CancelExecutionResponse
 */
async function cancelExecution(request: CancelExecutionRequest): CancelExecutionResponse {
  var runtime = new Util.RuntimeOptions{};
  return cancelExecutionWithOptions(request, runtime);
}

model ChangeResourceGroupRequest {
  newResourceGroupId?: string(name='NewResourceGroupId', description='The ID of the resource group to which the cloud resource is to be moved. You can use resource groups to manage resources owned by your Alibaba Cloud account. Resource groups simplify the resource and permission management of your Alibaba Cloud account. For more information, see [What is Resource Management?](https://help.aliyun.com/document_detail/94475.html)

This parameter is required.', example='rg-acfm3peow3k****'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
  resourceId?: string(name='ResourceId', description='The ID of the cloud resource that you want to move to another resource group.

*   If the ResourceType parameter is set to template, set the ResourceId parameter to the name of the template.
*   If the ResourceType parameter is set to parameter, set the ResourceId parameter to the name of the parameter.
*   If the ResourceType parameter is set to secretparameter, set the ResourceId parameter to the name of the encryption parameter.
*   If the ResourceType parameter is set to stateconfiguration, set the ResourceId parameter to the ID of the desired-state configuration.
*   If the ResourceType parameter is set to application, set the ResourceId parameter to the name of the application.

This parameter is required.', example='TemplateName'),
  resourceType?: string(name='ResourceType', description='The type of the cloud resource. Valid values:

*   template: template
*   parameter: parameter
*   secretparameter: encryption parameter
*   stateconfiguration: desired-state configuration
*   application: application

This parameter is required.', example='template'),
}

model ChangeResourceGroupResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='0620E49F-B884-5F98-A834-69D72922E5CF'),
}

model ChangeResourceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ChangeResourceGroupResponseBody(name='body'),
}

/**
 * @summary Modifies the resource group to which a cloud resource belongs.
 *
 * @param request ChangeResourceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ChangeResourceGroupResponse
 */
async function changeResourceGroupWithOptions(request: ChangeResourceGroupRequest, runtime: Util.RuntimeOptions): ChangeResourceGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.newResourceGroupId)) {
    query['NewResourceGroupId'] = request.newResourceGroupId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ChangeResourceGroup',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the resource group to which a cloud resource belongs.
 *
 * @param request ChangeResourceGroupRequest
 * @return ChangeResourceGroupResponse
 */
async function changeResourceGroup(request: ChangeResourceGroupRequest): ChangeResourceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return changeResourceGroupWithOptions(request, runtime);
}

model ContinueDeployApplicationGroupRequest {
  applicationName?: string(name='ApplicationName', description='The name of the application.

This parameter is required.', example='MyApplication'),
  deployParameters?: string(name='DeployParameters', description='The deployment information about the application group.

This parameter is required.', example='{       "TemplateURL": "https://ros-template.oss-cn-zhangjiakou.aliyuncs.com/App_Management_Existing_Vpc_Ecs_Instance.json",       "Parameters": {         "ZoneId": "cn-hangzhou-k",         "ProjectName": "test",         "SystemDiskSize": 40,         "InstanceChargeType": "PostPaid",         "SecurityGroupId": "sg-bp1a4374akk63jl8tddy",         "VSwitchId": "vsw-bp1fcvc3zn0jrag86rrlm",         "SystemDiskCategory": "cloud_essd",         "InstancePassword": "******",         "InternetChargeType": "PayByTraffic",         "InstanceCount": 1,         "InternetMaxBandwidthOut": 0,         "VpcId": "vpc-bp1i99boyas8i8m9t3skp",         "EcsImageId": "centos_8_5_x64_20G_alibase_20211228.vhd",         "DataDiskSize": 100,         "EcsInstanceType": "ecs.s6-c1m4.small",         "DataDiskCategory": "cloud_efficiency",         "EnvironmentCommandId": "c-hz028fc3g031gcg"       }'),
  name?: string(name='Name', description='The name of the application group.

This parameter is required.', example='MyApplicationGroup'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
}

model ContinueDeployApplicationGroupResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='8AF4800A-A316-589A-90C4-313B1FEEB084'),
}

model ContinueDeployApplicationGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ContinueDeployApplicationGroupResponseBody(name='body'),
}

/**
 * @summary Continues deploying an application group when an error occurs for calling the DeployApplicationGroup operation. You can call this operation only for the applications which reside in the China (Hangzhou) region. Use an endpoint of the China (Hangzhou) region.
 *
 * @param request ContinueDeployApplicationGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ContinueDeployApplicationGroupResponse
 */
async function continueDeployApplicationGroupWithOptions(request: ContinueDeployApplicationGroupRequest, runtime: Util.RuntimeOptions): ContinueDeployApplicationGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.applicationName)) {
    query['ApplicationName'] = request.applicationName;
  }
  if (!Util.isUnset(request.deployParameters)) {
    query['DeployParameters'] = request.deployParameters;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ContinueDeployApplicationGroup',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Continues deploying an application group when an error occurs for calling the DeployApplicationGroup operation. You can call this operation only for the applications which reside in the China (Hangzhou) region. Use an endpoint of the China (Hangzhou) region.
 *
 * @param request ContinueDeployApplicationGroupRequest
 * @return ContinueDeployApplicationGroupResponse
 */
async function continueDeployApplicationGroup(request: ContinueDeployApplicationGroupRequest): ContinueDeployApplicationGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return continueDeployApplicationGroupWithOptions(request, runtime);
}

model CreateApplicationRequest {
  alarmConfig?: {
    contactGroups?: [ string ](name='ContactGroups', description='The alert contact groups.'),
    healthCheckUrl?: string(name='HealthCheckUrl', description='The health check URL of the application.', example='/healthcheck/tcp50122'),
    templateIds?: [ string ](name='TemplateIds', description='The alert templates.'),
  }(name='AlarmConfig', description='The configurations of application alerts.'),
  applicationSource?: string(name='ApplicationSource', description='The source of application.', example='{"Platform":"github","Owner":"githubUser","RepoName":"githubUser/repoName"}'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.', example='TF-CreateApplication-1647587475-84104b89-eba5-47a8-b2fd-807b8b7d'),
  description?: string(name='Description', description='The description of the application.', example='application'),
  name?: string(name='Name', description='The application name.

This parameter is required.', example='MyApplication'),
  regionId?: string(name='RegionId', description='The region ID. Set the value to cn-hangzhou.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m******'),
  serviceId?: string(name='ServiceId', description='The ID of the Compute Nest service that corresponds to the application template.', example='service-79538e30e44541b699d8'),
  tags?: map[string]any(name='Tags', description='The tags.', example='{"k1":"v1","k2":"v2"}'),
}

model CreateApplicationShrinkRequest {
  alarmConfigShrink?: string(name='AlarmConfig', description='The configurations of application alerts.'),
  applicationSource?: string(name='ApplicationSource', description='The source of application.', example='{"Platform":"github","Owner":"githubUser","RepoName":"githubUser/repoName"}'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.', example='TF-CreateApplication-1647587475-84104b89-eba5-47a8-b2fd-807b8b7d'),
  description?: string(name='Description', description='The description of the application.', example='application'),
  name?: string(name='Name', description='The application name.

This parameter is required.', example='MyApplication'),
  regionId?: string(name='RegionId', description='The region ID. Set the value to cn-hangzhou.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m******'),
  serviceId?: string(name='ServiceId', description='The ID of the Compute Nest service that corresponds to the application template.', example='service-79538e30e44541b699d8'),
  tagsShrink?: string(name='Tags', description='The tags.', example='{"k1":"v1","k2":"v2"}'),
}

model CreateApplicationResponseBody = {
  application?: {
    createDate?: string(name='CreateDate', description='The time when the application was created.', example='2021-09-07T09:17:46Z'),
    description?: string(name='Description', description='The description of the application.', example='application'),
    name?: string(name='Name', description='The application name.', example='Myapplication'),
    tags?: map[string]string(name='Tags', description='The tags.', example='{"k1":"v1","k2":"v2"}'),
    updateDate?: string(name='UpdateDate', description='The time when the application was updated.', example='2021-09-07T09:17:46Z'),
  }(name='Application', description='The information about the application.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='274917E8-8E74-5928-A82F-4940F52F7ACB'),
}

model CreateApplicationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateApplicationResponseBody(name='body'),
}

/**
 * @summary Creates an application. You can call this operation only for the applications that reside in the China (Hangzhou) region. Use an endpoint of the China (Hangzhou) region.
 *
 * @param tmpReq CreateApplicationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateApplicationResponse
 */
async function createApplicationWithOptions(tmpReq: CreateApplicationRequest, runtime: Util.RuntimeOptions): CreateApplicationResponse {
  Util.validateModel(tmpReq);
  var request = new CreateApplicationShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.alarmConfig)) {
    request.alarmConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.alarmConfig, 'AlarmConfig', 'json');
  }
  if (!Util.isUnset(tmpReq.tags)) {
    request.tagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tags, 'Tags', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.alarmConfigShrink)) {
    query['AlarmConfig'] = request.alarmConfigShrink;
  }
  if (!Util.isUnset(request.applicationSource)) {
    query['ApplicationSource'] = request.applicationSource;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.serviceId)) {
    query['ServiceId'] = request.serviceId;
  }
  if (!Util.isUnset(request.tagsShrink)) {
    query['Tags'] = request.tagsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateApplication',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates an application. You can call this operation only for the applications that reside in the China (Hangzhou) region. Use an endpoint of the China (Hangzhou) region.
 *
 * @param request CreateApplicationRequest
 * @return CreateApplicationResponse
 */
async function createApplication(request: CreateApplicationRequest): CreateApplicationResponse {
  var runtime = new Util.RuntimeOptions{};
  return createApplicationWithOptions(request, runtime);
}

model CreateApplicationGroupRequest {
  applicationName?: string(name='ApplicationName', description='The application name.

This parameter is required.', example='MyApplication'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.', example='-'),
  cmsGroupId?: string(name='CmsGroupId', description='The ID of the application group in CloudMonitor.', example='218026174'),
  deployRegionId?: string(name='DeployRegionId', description='The ID of the region in which the related sources reside.

This parameter is required.', example='cn-hangzhou'),
  description?: string(name='Description', description='The description of the application group.', example='ApplicationGroup'),
  importTagKey?: string(name='ImportTagKey', description='The key of the tag. You must set both the ImportTagKey and the ImportTagValue parameters, or leave both of them empty. If you do not set the ImportTagKey and ImportTagValue parameters, the application name is used for this parameter by default.', example='k1'),
  importTagValue?: string(name='ImportTagValue', description='The value of the tag. You must set both the ImportTagKey and the ImportTagValue parameters, or leave both of them empty. If you do not set the ImportTagKey and ImportTagValue parameters, the application group name is used for this parameter by default.', example='v1'),
  name?: string(name='Name', description='The name of the application group.

This parameter is required.', example='MyApplicationGroup'),
  regionId?: string(name='RegionId', description='The region ID. Set the value to cn-hangzhou.', example='cn-hangzhou'),
}

model CreateApplicationGroupResponseBody = {
  applicationGroup?: {
    applicationName?: string(name='ApplicationName', description='The application name.', example='MyApplication'),
    cmsGroupId?: string(name='CmsGroupId', description='The ID of the application group in CloudMonitor.', example='1245768'),
    createDate?: string(name='CreateDate', description='The time when the application group was created.', example='2021-09-07T10:28:25Z'),
    deployRegionId?: string(name='DeployRegionId', description='The ID of the region in which the related sources reside.', example='cn-hangzhou'),
    description?: string(name='Description', description='The description of the application group.', example='ApplicationGroup'),
    importTagKey?: string(name='ImportTagKey', description='The key of the tag.', example='k1'),
    importTagValue?: string(name='ImportTagValue', description='The value of the tag.', example='v1'),
    name?: string(name='Name', description='The name of the application group.', example='MyApplicationGroup'),
    updateDate?: string(name='UpdateDate', description='The time when the application group was updated.', example='2021-09-07T10:28:25Z'),
  }(name='ApplicationGroup', description='The information about the application group.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='0E6BEBD3-7F9E-5878-834B-097633AB5F33'),
}

model CreateApplicationGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateApplicationGroupResponseBody(name='body'),
}

/**
 * @summary Creates an application group. You can call this operation only for the application groups that reside in the China (Hangzhou) region. Use an endpoint of the China (Hangzhou) region.
 *
 * @param request CreateApplicationGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateApplicationGroupResponse
 */
async function createApplicationGroupWithOptions(request: CreateApplicationGroupRequest, runtime: Util.RuntimeOptions): CreateApplicationGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.applicationName)) {
    query['ApplicationName'] = request.applicationName;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.cmsGroupId)) {
    query['CmsGroupId'] = request.cmsGroupId;
  }
  if (!Util.isUnset(request.deployRegionId)) {
    query['DeployRegionId'] = request.deployRegionId;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.importTagKey)) {
    query['ImportTagKey'] = request.importTagKey;
  }
  if (!Util.isUnset(request.importTagValue)) {
    query['ImportTagValue'] = request.importTagValue;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateApplicationGroup',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates an application group. You can call this operation only for the application groups that reside in the China (Hangzhou) region. Use an endpoint of the China (Hangzhou) region.
 *
 * @param request CreateApplicationGroupRequest
 * @return CreateApplicationGroupResponse
 */
async function createApplicationGroup(request: CreateApplicationGroupRequest): CreateApplicationGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return createApplicationGroupWithOptions(request, runtime);
}

model CreateOpsItemRequest {
  category?: string(name='Category', description='The category.

Valid values:

*   Availability

    <!-- -->

    <!-- -->

    <!-- -->

*   Performance

    <!-- -->

    <!-- -->

    <!-- -->

*   Security

    <!-- -->

    <!-- -->

    <!-- -->

*   Cost

    <!-- -->

    <!-- -->

    <!-- -->

*   Recovery

    <!-- -->

    <!-- -->

    <!-- -->

This parameter is required.', example='Security'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.', example='123e56767-e89b-12d3-a456-426655440000'),
  dedupString?: string(name='DedupString', description='The string to be deduplicated.', example='ecs_instance_Sys'),
  description?: string(name='Description', description='The description of the operation.', example='OpsItem'),
  priority?: int32(name='Priority', description='The priority. Valid values: 1 to 5. 1 indicates the highest priority.', example='4'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
  resources?: string(name='Resources', description='The Alibaba Cloud Resource Names (ARNs) of the associated resources.', example='[\\\\"acs:oos:cn-hangzhou:1563457855438522:application/test-33333/applicationgroup/default-cn-hangzhou-1\\\\"]'),
  severity?: string(name='Severity', description='The severity level.

Valid values:

*   High

    <!-- -->

    <!-- -->

    <!-- -->

*   Low

    <!-- -->

    <!-- -->

    <!-- -->

*   Medium

    <!-- -->

    <!-- -->

    <!-- -->

*   Critical

    <!-- -->

    <!-- -->

    <!-- -->

This parameter is required.', example='Medium'),
  solutions?: string(name='Solutions', description='The solutions.', example='[{\\\\n \\\\\\\\"priority\\\\\\\\":3,\\\\n \\\\\\\\"type\\\\\\\\":\\\\\\\\"SingleAZEcs\\\\\\\\",\\\\n \\\\\\\\"url\\\\\\\\":\\\\\\\\"http://ecs.consle.aliyuncs.com\\\\\\\\",\\\\n \\\\\\\\"description\\\\\\\\":\\\\\\\\"Create Elastic Compute Service (ECS) instances in different zones and import them to an application group.\\\\\\\\"\\\\n}]'),
  source?: string(name='Source', description='The source business.

This parameter is required.', example='/aliyun/ecs'),
  tags?: map[string]any(name='Tags', description='The tags.', example='{
      "k1": "v1",
      "k2": "v2"
}'),
  title?: string(name='Title', description='The title of the O\\\\&M item.

This parameter is required.', example='ECS reboot is scheduled'),
}

model CreateOpsItemShrinkRequest {
  category?: string(name='Category', description='The category.

Valid values:

*   Availability

    <!-- -->

    <!-- -->

    <!-- -->

*   Performance

    <!-- -->

    <!-- -->

    <!-- -->

*   Security

    <!-- -->

    <!-- -->

    <!-- -->

*   Cost

    <!-- -->

    <!-- -->

    <!-- -->

*   Recovery

    <!-- -->

    <!-- -->

    <!-- -->

This parameter is required.', example='Security'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.', example='123e56767-e89b-12d3-a456-426655440000'),
  dedupString?: string(name='DedupString', description='The string to be deduplicated.', example='ecs_instance_Sys'),
  description?: string(name='Description', description='The description of the operation.', example='OpsItem'),
  priority?: int32(name='Priority', description='The priority. Valid values: 1 to 5. 1 indicates the highest priority.', example='4'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
  resources?: string(name='Resources', description='The Alibaba Cloud Resource Names (ARNs) of the associated resources.', example='[\\\\"acs:oos:cn-hangzhou:1563457855438522:application/test-33333/applicationgroup/default-cn-hangzhou-1\\\\"]'),
  severity?: string(name='Severity', description='The severity level.

Valid values:

*   High

    <!-- -->

    <!-- -->

    <!-- -->

*   Low

    <!-- -->

    <!-- -->

    <!-- -->

*   Medium

    <!-- -->

    <!-- -->

    <!-- -->

*   Critical

    <!-- -->

    <!-- -->

    <!-- -->

This parameter is required.', example='Medium'),
  solutions?: string(name='Solutions', description='The solutions.', example='[{\\\\n \\\\\\\\"priority\\\\\\\\":3,\\\\n \\\\\\\\"type\\\\\\\\":\\\\\\\\"SingleAZEcs\\\\\\\\",\\\\n \\\\\\\\"url\\\\\\\\":\\\\\\\\"http://ecs.consle.aliyuncs.com\\\\\\\\",\\\\n \\\\\\\\"description\\\\\\\\":\\\\\\\\"Create Elastic Compute Service (ECS) instances in different zones and import them to an application group.\\\\\\\\"\\\\n}]'),
  source?: string(name='Source', description='The source business.

This parameter is required.', example='/aliyun/ecs'),
  tagsShrink?: string(name='Tags', description='The tags.', example='{
      "k1": "v1",
      "k2": "v2"
}'),
  title?: string(name='Title', description='The title of the O\\\\&M item.

This parameter is required.', example='ECS reboot is scheduled'),
}

model CreateOpsItemResponseBody = {
  opsItem?: {
    attributes?: string(name='Attributes', description='The attributes of the O\\\\&M item.', example='{\\\\"regionId\\\\":\\\\"cn-zhangjiakou\\\\",\\\\"appId\\\\":\\\\"992BKO1X75GRQ4E8\\\\",\\\\"instanceId\\\\":\\\\"i-8vbcymxagqsyyyjppbr4\\\\",\\\\"instance_name\\\\":\\\\"cdae\\\\"}'),
    category?: string(name='Category', description='The category of the O\\\\&M item.', example='Security'),
    createDate?: string(name='CreateDate', description='The time when the O\\\\&M item was created.', example='2023-03-24T03:55Z'),
    createdBy?: string(name='CreatedBy', description='The user who created the O\\\\&M item.', example='root(130900000)'),
    description?: string(name='Description', description='The description of the O\\\\&M item.', example='OpsItem'),
    lastModifiedBy?: string(name='LastModifiedBy', description='The user who last modified the O\\\\&M item.', example='root(130900000)'),
    opsItemId?: string(name='OpsItemId', description='The ID of the O\\\\&M item.', example='oi-dba9c6eec9254a4d87c1'),
    priority?: int32(name='Priority', description='The priority of the O\\\\&M item.', example='2'),
    resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
    resources?: string(name='Resources', description='The ARNs of the associated resources.', example='[\\\\"acs:oos:cn-hangzhou:1563457855438522:application/dingTest/applicationgroup/fltest\\\\"]'),
    severity?: string(name='Severity', description='The severity level of the O\\\\&M item.', example='Medium'),
    solutions?: string(name='Solutions', description='The solutions.', example='[{\\\\n \\\\\\\\"priority\\\\\\\\":3,\\\\n \\\\\\\\"type\\\\\\\\":\\\\\\\\"url\\\\\\\\",\\\\n \\\\\\\\"url\\\\\\\\":\\\\\\\\"https://example..com\\\\\\\\",\\\\n \\\\\\\\"description\\\\\\\\":\\\\\\\\"Specify a cross-zone high availability cluster. \\\\\\\\"\\\\n}]'),
    source?: string(name='Source', description='The source business of the O\\\\&M item.', example='/aliyun/ecs'),
    status?: string(name='Status', description='The state of the O\\\\&M item.', example='Running'),
    tags?: map[string]any(name='Tags', description='The tags of the O\\\\&M item.', example='{"k1": "v1"}'),
    title?: string(name='Title', description='The title of the O\\\\&M item.', example='ECS reboot is scheduled'),
    updateDate?: string(name='UpdateDate', description='The time when the O\\\\&M item was updated.', example='2023-03-24T03:55Z'),
  }(name='OpsItem', description='The information about the O\\\\&M item.'),
  requestId?: string(name='RequestId', description='The request ID.', example='DA4F08D4-DA54-5407-84B9-108C71D75B17'),
}

model CreateOpsItemResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateOpsItemResponseBody(name='body'),
}

/**
 * @summary Creates an O\\\\\\\\\\\\&M Item.
 *
 * @param tmpReq CreateOpsItemRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateOpsItemResponse
 */
async function createOpsItemWithOptions(tmpReq: CreateOpsItemRequest, runtime: Util.RuntimeOptions): CreateOpsItemResponse {
  Util.validateModel(tmpReq);
  var request = new CreateOpsItemShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.tags)) {
    request.tagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tags, 'Tags', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.category)) {
    query['Category'] = request.category;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dedupString)) {
    query['DedupString'] = request.dedupString;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.priority)) {
    query['Priority'] = request.priority;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resources)) {
    query['Resources'] = request.resources;
  }
  if (!Util.isUnset(request.severity)) {
    query['Severity'] = request.severity;
  }
  if (!Util.isUnset(request.solutions)) {
    query['Solutions'] = request.solutions;
  }
  if (!Util.isUnset(request.source)) {
    query['Source'] = request.source;
  }
  if (!Util.isUnset(request.tagsShrink)) {
    query['Tags'] = request.tagsShrink;
  }
  if (!Util.isUnset(request.title)) {
    query['Title'] = request.title;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateOpsItem',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates an O\\\\\\\\\\\\&M Item.
 *
 * @param request CreateOpsItemRequest
 * @return CreateOpsItemResponse
 */
async function createOpsItem(request: CreateOpsItemRequest): CreateOpsItemResponse {
  var runtime = new Util.RuntimeOptions{};
  return createOpsItemWithOptions(request, runtime);
}

model CreateParameterRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can be up to 64 characters in length, and can contain letters, digits, hyphens (-), and underscores (_). For more information, see "How to ensure idempotence".', example='123e4567-e89b-12d3-a456-42665544****'),
  constraints?: string(name='Constraints', description='The constraints of the common parameter. By default, this parameter is null. Valid values:

*   AllowedValues: The value that is allowed for the common parameter. It must be an array string.
*   AllowedPattern: The pattern that is allowed for the common parameter. It must be a regular expression.
*   MinLength: The minimum length of the common parameter.
*   MaxLength: The maximum length of the common parameter.', example='{
    "AllowedValues": [
        "parameter"
    ],
    "AllowedPattern": "parameter",
    "MinLength": 0,
    "MaxLength": 20
}'),
  description?: string(name='Description', description='The description of the common parameter. The description must be 1 to 200 characters in length.', example='parameter'),
  name?: string(name='Name', description='The name of the parameter. The name must be 1 to 200 characters in length, and can contain letters, digits, hyphens (-), and underscores (_). It cannot start with ALIYUN, ACS, ALIBABA, ALICLOUD, or OOS.

This parameter is required.', example='MyParameter'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
  tags?: map[string]any(name='Tags', description='The tags.', example='{"k1": "v1", "k2": "v2"}'),
  type?: string(name='Type', description='The data type of the parameter. Valid values: String and StringList.

This parameter is required.', example='String'),
  value?: string(name='Value', description='The value of the common parameter. The value must be 1 to 4096 characters in length.

This parameter is required.', example='parameter'),
}

model CreateParameterShrinkRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can be up to 64 characters in length, and can contain letters, digits, hyphens (-), and underscores (_). For more information, see "How to ensure idempotence".', example='123e4567-e89b-12d3-a456-42665544****'),
  constraints?: string(name='Constraints', description='The constraints of the common parameter. By default, this parameter is null. Valid values:

*   AllowedValues: The value that is allowed for the common parameter. It must be an array string.
*   AllowedPattern: The pattern that is allowed for the common parameter. It must be a regular expression.
*   MinLength: The minimum length of the common parameter.
*   MaxLength: The maximum length of the common parameter.', example='{
    "AllowedValues": [
        "parameter"
    ],
    "AllowedPattern": "parameter",
    "MinLength": 0,
    "MaxLength": 20
}'),
  description?: string(name='Description', description='The description of the common parameter. The description must be 1 to 200 characters in length.', example='parameter'),
  name?: string(name='Name', description='The name of the parameter. The name must be 1 to 200 characters in length, and can contain letters, digits, hyphens (-), and underscores (_). It cannot start with ALIYUN, ACS, ALIBABA, ALICLOUD, or OOS.

This parameter is required.', example='MyParameter'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
  tagsShrink?: string(name='Tags', description='The tags.', example='{"k1": "v1", "k2": "v2"}'),
  type?: string(name='Type', description='The data type of the parameter. Valid values: String and StringList.

This parameter is required.', example='String'),
  value?: string(name='Value', description='The value of the common parameter. The value must be 1 to 4096 characters in length.

This parameter is required.', example='parameter'),
}

model CreateParameterResponseBody = {
  parameter?: {
    constraints?: string(name='Constraints', description='The constraints of the common parameter.', example='"{\\\\"AllowedValues\\\\":[\\\\"parameter\\\\"],\\\\"AllowedPattern\\\\":\\\\"parameter\\\\",\\\\"MinLength\\\\":0,\\\\"MaxLength\\\\":20}"'),
    createdBy?: string(name='CreatedBy', description='The user who created the common parameter.', example='root(130900000)'),
    createdDate?: string(name='CreatedDate', description='The time when the common parameter was created.', example='2020-09-01T08:01:43Z'),
    description?: string(name='Description', description='The description of the common parameter.', example='parameter'),
    id?: string(name='Id', description='The ID of the common parameter.', example='p-4c4b401cab6747xxxxxx'),
    name?: string(name='Name', description='The name of the common parameter.', example='MyParameter'),
    parameterVersion?: int32(name='ParameterVersion', description='The version number of the common parameter.', example='1'),
    resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
    shareType?: string(name='ShareType', description='The share type of the common parameter.', example='Private'),
    tags?: map[string]any(name='Tags', description='The tags.', example='{"k1": "v1", "k2": "v2"}'),
    type?: string(name='Type', description='The type of the common parameter.', example='String'),
    updatedBy?: string(name='UpdatedBy', description='The user who updated the common parameter.', example='root(130900000)'),
    updatedDate?: string(name='UpdatedDate', description='The time when the common parameter was updated.', example='2020-09-01T08:01:43Z'),
  }(name='Parameter', description='The information about the common parameter.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='0B419FF3-ABC6-4DF0-95E5-636DC8CBB8AF'),
}

model CreateParameterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateParameterResponseBody(name='body'),
}

/**
 * @summary Creates a common parameter.
 *
 * @param tmpReq CreateParameterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateParameterResponse
 */
async function createParameterWithOptions(tmpReq: CreateParameterRequest, runtime: Util.RuntimeOptions): CreateParameterResponse {
  Util.validateModel(tmpReq);
  var request = new CreateParameterShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.tags)) {
    request.tagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tags, 'Tags', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.constraints)) {
    query['Constraints'] = request.constraints;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.tagsShrink)) {
    query['Tags'] = request.tagsShrink;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  if (!Util.isUnset(request.value)) {
    query['Value'] = request.value;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateParameter',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a common parameter.
 *
 * @param request CreateParameterRequest
 * @return CreateParameterResponse
 */
async function createParameter(request: CreateParameterRequest): CreateParameterResponse {
  var runtime = new Util.RuntimeOptions{};
  return createParameterWithOptions(request, runtime);
}

model CreatePatchBaselineRequest {
  approvalRules?: string(name='ApprovalRules', description='The rules of scanning and installing patches for the specified operating system.

This parameter is required.', example='{"PatchRules":[{"PatchFilterGroup":[{"Key":"PatchSet","Values":["OS"]},{"Key":"ProductFamily","Values":["Windows"]},{"Key":"Product","Values":["Windows 10","Windows 7"]},{"Key":"Classification","Values":["Security Updates","Updates","Update Rollups","Critical Updates"]},{"Key":"Severity","Values":["Critical","Important","Moderate"]}],"ApproveAfterDays":7,"ApproveUntilDate":"","EnableNonSecurity":true,"ComplianceLevel":"Medium"}]}'),
  approvedPatches?: [ string ](name='ApprovedPatches', description='The approved patches.'),
  approvedPatchesEnableNonSecurity?: boolean(name='ApprovedPatchesEnableNonSecurity', description='Specifies whether the approved patch involves updates other than security-related updates.', example='true'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.', example='-'),
  description?: string(name='Description', description='The description of the patch baseline.', example='PatchBaseline'),
  name?: string(name='Name', description='The name of the patch baseline.

This parameter is required.', example='MyPatchBaseline'),
  operationSystem?: string(name='OperationSystem', description='The type of the operating system. Valid values:

*   Windows
*   Ubuntu
*   CentOS
*   Debian
*   AliyunLinux
*   RedhatEnterpriseLinux
*   Anolis
*   AlmaLinux

This parameter is required.', example='Windows'),
  regionId?: string(name='RegionId', description='The ID of the region in which you want to create a patch baseline.', example='cn-hangzhou'),
  rejectedPatches?: [ string ](name='RejectedPatches', description='The rejected patches.'),
  rejectedPatchesAction?: string(name='RejectedPatchesAction', description='The action of the rejected patch.', example='ALLOW_AS_DEPENDENCY'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
  sources?: [ string ](name='Sources', description='The patch source configurations.'),
  tags?: [ 
    {
      key?: string(name='Key', description='The key of the tag.', example='key'),
      value?: string(name='Value', description='The value of the tag.', example='value'),
    }
  ](name='Tags', description='The tags.'),
}

model CreatePatchBaselineShrinkRequest {
  approvalRules?: string(name='ApprovalRules', description='The rules of scanning and installing patches for the specified operating system.

This parameter is required.', example='{"PatchRules":[{"PatchFilterGroup":[{"Key":"PatchSet","Values":["OS"]},{"Key":"ProductFamily","Values":["Windows"]},{"Key":"Product","Values":["Windows 10","Windows 7"]},{"Key":"Classification","Values":["Security Updates","Updates","Update Rollups","Critical Updates"]},{"Key":"Severity","Values":["Critical","Important","Moderate"]}],"ApproveAfterDays":7,"ApproveUntilDate":"","EnableNonSecurity":true,"ComplianceLevel":"Medium"}]}'),
  approvedPatchesShrink?: string(name='ApprovedPatches', description='The approved patches.'),
  approvedPatchesEnableNonSecurity?: boolean(name='ApprovedPatchesEnableNonSecurity', description='Specifies whether the approved patch involves updates other than security-related updates.', example='true'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.', example='-'),
  description?: string(name='Description', description='The description of the patch baseline.', example='PatchBaseline'),
  name?: string(name='Name', description='The name of the patch baseline.

This parameter is required.', example='MyPatchBaseline'),
  operationSystem?: string(name='OperationSystem', description='The type of the operating system. Valid values:

*   Windows
*   Ubuntu
*   CentOS
*   Debian
*   AliyunLinux
*   RedhatEnterpriseLinux
*   Anolis
*   AlmaLinux

This parameter is required.', example='Windows'),
  regionId?: string(name='RegionId', description='The ID of the region in which you want to create a patch baseline.', example='cn-hangzhou'),
  rejectedPatchesShrink?: string(name='RejectedPatches', description='The rejected patches.'),
  rejectedPatchesAction?: string(name='RejectedPatchesAction', description='The action of the rejected patch.', example='ALLOW_AS_DEPENDENCY'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
  sourcesShrink?: string(name='Sources', description='The patch source configurations.'),
  tagsShrink?: string(name='Tags', description='The tags.'),
}

model CreatePatchBaselineResponseBody = {
  patchBaseline?: {
    approvalRules?: string(name='ApprovalRules', description='The rules of scanning and installing patches for the specified operating system.', example='{"PatchRules":[{"PatchFilterGroup":[{"Key":"PatchSet","Values":["OS"]},{"Key":"ProductFamily","Values":["Windows"]},{"Key":"Product","Values":["Windows 10","Windows 7"]},{"Key":"Classification","Values":["Security Updates","Updates","Update Rollups","Critical Updates"]},{"Key":"Severity","Values":["Critical","Important","Moderate"]}],"ApproveAfterDays":7,"ApproveUntilDate":"","EnableNonSecurity":true,"ComplianceLevel":"Medium"}]}'),
    approvedPatches?: [ string ](name='ApprovedPatches', description='The approved patches.'),
    approvedPatchesEnableNonSecurity?: boolean(name='ApprovedPatchesEnableNonSecurity', description='Indicates whether the approved patch involves updates other than security-related updates.', example='true'),
    createdBy?: string(name='CreatedBy', description='The creator of the patch baseline.', example='root(130900000)'),
    createdDate?: string(name='CreatedDate', description='The time when the patch baseline was created.', example='2021-09-08T06:25:41Z'),
    description?: string(name='Description', description='The description of the patch baseline.', example='PatchBaseline'),
    id?: string(name='Id', description='The ID of the patch baseline.', example='pb-0a0aeda72ed147eb97ea'),
    name?: string(name='Name', description='The name of the patch baseline.', example='MyPatchBaseline'),
    operationSystem?: string(name='OperationSystem', description='The type of the operating system.', example='Windows'),
    rejectedPatches?: [ string ](name='RejectedPatches', description='The rejected patches.'),
    rejectedPatchesAction?: string(name='RejectedPatchesAction', description='The action of the rejected patch.', example='"ALLOW_AS_DEPENDENCY"'),
    resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfm3comlufxpva'),
    shareType?: string(name='ShareType', description='The share type of the patch baseline.', example='Private'),
    sources?: [ string ](name='Sources', description='The patch source configurations.'),
    tags?: [ 
      {
        tagKey?: string(name='TagKey', description='The key of the tag.', example='key'),
        tagValue?: string(name='TagValue', description='The value of the tag.', example='value'),
      }
    ](name='Tags', description='The tags.'),
    updatedBy?: string(name='UpdatedBy', description='The Alibaba Cloud account that last modified the information about the patch baseline.', example='root(130900000)'),
    updatedDate?: string(name='UpdatedDate', description='The time when the information about the patch baseline was last modified.', example='2021-09-08T06:25:41Z'),
  }(name='PatchBaseline', description='The details of the patch baseline.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='A5173FF6-D10D-5E8C-8F71-943C2A3E25C0'),
}

model CreatePatchBaselineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreatePatchBaselineResponseBody(name='body'),
}

/**
 * @summary Creates a patch baseline.
 *
 * @param tmpReq CreatePatchBaselineRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreatePatchBaselineResponse
 */
async function createPatchBaselineWithOptions(tmpReq: CreatePatchBaselineRequest, runtime: Util.RuntimeOptions): CreatePatchBaselineResponse {
  Util.validateModel(tmpReq);
  var request = new CreatePatchBaselineShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.approvedPatches)) {
    request.approvedPatchesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.approvedPatches, 'ApprovedPatches', 'json');
  }
  if (!Util.isUnset(tmpReq.rejectedPatches)) {
    request.rejectedPatchesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.rejectedPatches, 'RejectedPatches', 'json');
  }
  if (!Util.isUnset(tmpReq.sources)) {
    request.sourcesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.sources, 'Sources', 'json');
  }
  if (!Util.isUnset(tmpReq.tags)) {
    request.tagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tags, 'Tags', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.approvalRules)) {
    query['ApprovalRules'] = request.approvalRules;
  }
  if (!Util.isUnset(request.approvedPatchesShrink)) {
    query['ApprovedPatches'] = request.approvedPatchesShrink;
  }
  if (!Util.isUnset(request.approvedPatchesEnableNonSecurity)) {
    query['ApprovedPatchesEnableNonSecurity'] = request.approvedPatchesEnableNonSecurity;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.operationSystem)) {
    query['OperationSystem'] = request.operationSystem;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.rejectedPatchesShrink)) {
    query['RejectedPatches'] = request.rejectedPatchesShrink;
  }
  if (!Util.isUnset(request.rejectedPatchesAction)) {
    query['RejectedPatchesAction'] = request.rejectedPatchesAction;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.sourcesShrink)) {
    query['Sources'] = request.sourcesShrink;
  }
  if (!Util.isUnset(request.tagsShrink)) {
    query['Tags'] = request.tagsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreatePatchBaseline',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a patch baseline.
 *
 * @param request CreatePatchBaselineRequest
 * @return CreatePatchBaselineResponse
 */
async function createPatchBaseline(request: CreatePatchBaselineRequest): CreatePatchBaselineResponse {
  var runtime = new Util.RuntimeOptions{};
  return createPatchBaselineWithOptions(request, runtime);
}

model CreateSecretParameterRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can be up to 64 characters in length, and can contain letters, digits, hyphens (-), and underscores (_). For more information, see "How to ensure idempotence".', example='123e4567-e89b-12d3-a456-42665544****'),
  constraints?: string(name='Constraints', description='The constraints of the encryption parameter. By default, this parameter is null. Valid values:

*   AllowedValues: The value that is allowed for the encryption parameter. It must be an array string.
*   AllowedPattern: The pattern that is allowed for the encryption parameter. It must be a regular expression.
*   MinLength: The minimum length of the encryption parameter.
*   MaxLength: The maximum length of the encryption parameter.', example='\\\\"{\\\\"\\\\"AllowedValues":["secretparameter"],"AllowedPattern":"secretparameter","MinLength":0,"MaxLength":20}\\\\"'),
  DKMSInstanceId?: string(name='DKMSInstanceId', description='The instance ID of the KMS instance.', example='kst-hzz****'),
  description?: string(name='Description', description='The description of the encryption parameter. The description must be 1 to 200 characters in length.', example='SecretParameter'),
  keyId?: string(name='KeyId', description='The key ID of Key Management Service (KMS) that is used to encrypt the parameter.', example='80e9409f-78fa-42ab-84bd-83f40c******'),
  name?: string(name='Name', description='The name of the parameter. The name must be 1 to 180 characters in length, and can contain letters, digits, hyphens (-), and underscores (_). It cannot start with ALIYUN, ACS, ALIBABA, ALICLOUD, or OOS.

This parameter is required.', example='MySecretParameter'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
  tags?: map[string]any(name='Tags', description='The tags.', example='{"k1": "v1", "k2": "v2"}'),
  type?: string(name='Type', description='The type of the parameter. Set the value to Secret.', example='Secret'),
  value?: string(name='Value', description='The value of the encryption parameter. The value must be 1 to 4096 characters in length.

This parameter is required.', example='SecretParameter'),
}

model CreateSecretParameterShrinkRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can be up to 64 characters in length, and can contain letters, digits, hyphens (-), and underscores (_). For more information, see "How to ensure idempotence".', example='123e4567-e89b-12d3-a456-42665544****'),
  constraints?: string(name='Constraints', description='The constraints of the encryption parameter. By default, this parameter is null. Valid values:

*   AllowedValues: The value that is allowed for the encryption parameter. It must be an array string.
*   AllowedPattern: The pattern that is allowed for the encryption parameter. It must be a regular expression.
*   MinLength: The minimum length of the encryption parameter.
*   MaxLength: The maximum length of the encryption parameter.', example='\\\\"{\\\\"\\\\"AllowedValues":["secretparameter"],"AllowedPattern":"secretparameter","MinLength":0,"MaxLength":20}\\\\"'),
  DKMSInstanceId?: string(name='DKMSInstanceId', description='The instance ID of the KMS instance.', example='kst-hzz****'),
  description?: string(name='Description', description='The description of the encryption parameter. The description must be 1 to 200 characters in length.', example='SecretParameter'),
  keyId?: string(name='KeyId', description='The key ID of Key Management Service (KMS) that is used to encrypt the parameter.', example='80e9409f-78fa-42ab-84bd-83f40c******'),
  name?: string(name='Name', description='The name of the parameter. The name must be 1 to 180 characters in length, and can contain letters, digits, hyphens (-), and underscores (_). It cannot start with ALIYUN, ACS, ALIBABA, ALICLOUD, or OOS.

This parameter is required.', example='MySecretParameter'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
  tagsShrink?: string(name='Tags', description='The tags.', example='{"k1": "v1", "k2": "v2"}'),
  type?: string(name='Type', description='The type of the parameter. Set the value to Secret.', example='Secret'),
  value?: string(name='Value', description='The value of the encryption parameter. The value must be 1 to 4096 characters in length.

This parameter is required.', example='SecretParameter'),
}

model CreateSecretParameterResponseBody = {
  parameter?: {
    constraints?: string(name='Constraints', description='The constraints of the encryption parameter.', example='\\\\"{ 	"AllowedValues": ["secretparameter"], 	"AllowedPattern": "secretparameter", 	"MinLength": 0, 	"MaxLength": 20 }\\\\"'),
    createdBy?: string(name='CreatedBy', description='The user who created the encryption parameter.', example='root(130900000)'),
    createdDate?: string(name='CreatedDate', description='The time when the encryption parameter was created.', example='2020-09-01T09:30:36Z'),
    DKMSInstanceId?: string(name='DKMSInstanceId', description='The instance ID of the KMS instance.', example='kst-hzz****'),
    description?: string(name='Description', description='The description of the encryption parameter.', example='SecretParameter'),
    id?: string(name='Id', description='The ID of the encryption parameter.', example='p-0b0fff9919c946xxxxxx'),
    keyId?: string(name='KeyId', description='The key ID of KMS that is used to encrypt the parameter.', example='80e9409f-78fa-42ab-84bd-83f40c******'),
    name?: string(name='Name', description='The name of the encryption parameter.', example='MyParameter'),
    parameterVersion?: int32(name='ParameterVersion', description='The version number of the encryption parameter.', example='1'),
    resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
    shareType?: string(name='ShareType', description='The share type of the encryption parameter.', example='Private'),
    tags?: map[string]any(name='Tags', description='The tags.', example='{"k1": "v1", "k2": "v2"}'),
    type?: string(name='Type', description='The type of the parameter.', example='Secret'),
    updatedBy?: string(name='UpdatedBy', description='The user who updated the encryption parameter.', example='root(130900000)'),
    updatedDate?: string(name='UpdatedDate', description='The time when the encryption parameter was updated.', example='2020-09-01T09:30:36Z'),
  }(name='Parameter', description='The information about the encryption parameter.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='0B419FF3-ABC6-4DF0-95E5-636DC8CBB8AF'),
}

model CreateSecretParameterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateSecretParameterResponseBody(name='body'),
}

/**
 * @summary Creates an encryption parameter. Make sure that you have the permissions to call this operation.
 *
 * @param tmpReq CreateSecretParameterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateSecretParameterResponse
 */
async function createSecretParameterWithOptions(tmpReq: CreateSecretParameterRequest, runtime: Util.RuntimeOptions): CreateSecretParameterResponse {
  Util.validateModel(tmpReq);
  var request = new CreateSecretParameterShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.tags)) {
    request.tagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tags, 'Tags', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.constraints)) {
    query['Constraints'] = request.constraints;
  }
  if (!Util.isUnset(request.DKMSInstanceId)) {
    query['DKMSInstanceId'] = request.DKMSInstanceId;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.keyId)) {
    query['KeyId'] = request.keyId;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.tagsShrink)) {
    query['Tags'] = request.tagsShrink;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  if (!Util.isUnset(request.value)) {
    query['Value'] = request.value;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateSecretParameter',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates an encryption parameter. Make sure that you have the permissions to call this operation.
 *
 * @param request CreateSecretParameterRequest
 * @return CreateSecretParameterResponse
 */
async function createSecretParameter(request: CreateSecretParameterRequest): CreateSecretParameterResponse {
  var runtime = new Util.RuntimeOptions{};
  return createSecretParameterWithOptions(request, runtime);
}

model CreateStateConfigurationRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.', example='DASKJJLKADS-AHKLJHJSAKL-AJK'),
  configureMode?: string(name='ConfigureMode', description='The configuration mode. Valid values: ApplyOnce: The configuration is applied only once. After a configuration is updated, the new configuration is applied. ApplyAndMonitor: The configuration is applied only once. After the configuration is applied, the system only checks whether the configuration is migrated in the future. ApplyAndAutoCorrect: The configuration is always applied.', example='ApplyOnce'),
  description?: string(name='Description', description='The description of the desired-state configuration.', example='The region ID.'),
  parameters?: string(name='Parameters', description='The parameters.', example='{     "policy": {       "ACS:Application": {         "Collection": "Enabled"       },       "ACS:Network": {         "Collection": "Enabled"       }     }   }'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-acfmxsn4m4******'),
  scheduleExpression?: string(name='ScheduleExpression', description='The schedule expression. The interval between two schedules must be a minimum of 30 minutes.

This parameter is required.', example='The ID of the resource group.'),
  scheduleType?: string(name='ScheduleType', description='The schedule type. Set the value to rate.

This parameter is required.', example='rate'),
  tags?: map[string]any(name='Tags', description='The tags to be added to the configuration.', example='{"Key": "oos", "Value": "inventory"}'),
  targets?: string(name='Targets', description='The resources to be queried.

This parameter is required.', example='{     "ResourceType": "ALIYUN::ECS::Instance",     "Filters": [       {         "Type": "All",         "RegionId": "cn-hangzhou",         "Parameters": {           "RegionId": "cn-hangzhou",           "Status": "Running"         }       }     ]   }'),
  templateName?: string(name='TemplateName', description='The name of the template. The name must be 1 to 200 characters in length and can contain letters, digits, hyphens (-), and underscores (_).

This parameter is required.', example='ACS-ECS-InventoryDataCollection'),
  templateVersion?: string(name='TemplateVersion', description='The version number of the template. If you do not specify this parameter, the latest version of the template is used.', example='v1'),
}

model CreateStateConfigurationShrinkRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.', example='DASKJJLKADS-AHKLJHJSAKL-AJK'),
  configureMode?: string(name='ConfigureMode', description='The configuration mode. Valid values: ApplyOnce: The configuration is applied only once. After a configuration is updated, the new configuration is applied. ApplyAndMonitor: The configuration is applied only once. After the configuration is applied, the system only checks whether the configuration is migrated in the future. ApplyAndAutoCorrect: The configuration is always applied.', example='ApplyOnce'),
  description?: string(name='Description', description='The description of the desired-state configuration.', example='The region ID.'),
  parameters?: string(name='Parameters', description='The parameters.', example='{     "policy": {       "ACS:Application": {         "Collection": "Enabled"       },       "ACS:Network": {         "Collection": "Enabled"       }     }   }'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-acfmxsn4m4******'),
  scheduleExpression?: string(name='ScheduleExpression', description='The schedule expression. The interval between two schedules must be a minimum of 30 minutes.

This parameter is required.', example='The ID of the resource group.'),
  scheduleType?: string(name='ScheduleType', description='The schedule type. Set the value to rate.

This parameter is required.', example='rate'),
  tagsShrink?: string(name='Tags', description='The tags to be added to the configuration.', example='{"Key": "oos", "Value": "inventory"}'),
  targets?: string(name='Targets', description='The resources to be queried.

This parameter is required.', example='{     "ResourceType": "ALIYUN::ECS::Instance",     "Filters": [       {         "Type": "All",         "RegionId": "cn-hangzhou",         "Parameters": {           "RegionId": "cn-hangzhou",           "Status": "Running"         }       }     ]   }'),
  templateName?: string(name='TemplateName', description='The name of the template. The name must be 1 to 200 characters in length and can contain letters, digits, hyphens (-), and underscores (_).

This parameter is required.', example='ACS-ECS-InventoryDataCollection'),
  templateVersion?: string(name='TemplateVersion', description='The version number of the template. If you do not specify this parameter, the latest version of the template is used.', example='v1'),
}

model CreateStateConfigurationResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1306108F-610C-40FD-AAD5-DA13E8B00BE9'),
  stateConfiguration?: {
    configureMode?: string(name='ConfigureMode', description='The configuration mode. Valid values:', example='ApplyAndAutoCorrect'),
    createTime?: string(name='CreateTime', description='The time when the desired-state configuration was created.', example='2021-03-22T03:13:32Z'),
    description?: string(name='Description', description='The description.', example='collect inventory data'),
    parameters?: map[string]any(name='Parameters', description='The parameters.', example='{"policy": {"ACS:Network": {"Collection": "Enabled"}, "ACS:Application": {"Collection": "Enabled"}}}'),
    resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-acfmxsn4m4******'),
    scheduleExpression?: string(name='ScheduleExpression', description='The schedule expression.', example='1 hour'),
    scheduleType?: string(name='ScheduleType', description='The schedule type.', example='rate'),
    stateConfigurationId?: string(name='StateConfigurationId', description='The ID of the desired-state configuration.', example='sc-a538febe18fabcdef'),
    tags?: map[string]any(name='Tags', description='The tags added to the configuration.', example='{"Key": "oos", "Value": "inventory"}'),
    targets?: string(name='Targets', description='The queried resources.', example='{     "ResourceType": "ALIYUN::ECS::Instance",     "Filters": [       {         "Type": "All",         "RegionId": "cn-hangzhou",         "Parameters": {           "RegionId": "cn-hangzhou",           "Status": "Running"         }       }     ]   }'),
    templateId?: string(name='TemplateId', description='The template ID.', example='t-1234asadf'),
    templateName?: string(name='TemplateName', description='The name of the template.', example='ACS-ECS-InventoryDataCollection'),
    templateVersion?: string(name='TemplateVersion', description='The name of the template version.', example='v1'),
  }(name='StateConfiguration', description='The information about the desired-state configuration.'),
}

model CreateStateConfigurationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateStateConfigurationResponseBody(name='body'),
}

/**
 * @summary Creates a desired-state configuration.
 *
 * @param tmpReq CreateStateConfigurationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateStateConfigurationResponse
 */
async function createStateConfigurationWithOptions(tmpReq: CreateStateConfigurationRequest, runtime: Util.RuntimeOptions): CreateStateConfigurationResponse {
  Util.validateModel(tmpReq);
  var request = new CreateStateConfigurationShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.tags)) {
    request.tagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tags, 'Tags', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.configureMode)) {
    query['ConfigureMode'] = request.configureMode;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.parameters)) {
    query['Parameters'] = request.parameters;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.scheduleExpression)) {
    query['ScheduleExpression'] = request.scheduleExpression;
  }
  if (!Util.isUnset(request.scheduleType)) {
    query['ScheduleType'] = request.scheduleType;
  }
  if (!Util.isUnset(request.tagsShrink)) {
    query['Tags'] = request.tagsShrink;
  }
  if (!Util.isUnset(request.targets)) {
    query['Targets'] = request.targets;
  }
  if (!Util.isUnset(request.templateName)) {
    query['TemplateName'] = request.templateName;
  }
  if (!Util.isUnset(request.templateVersion)) {
    query['TemplateVersion'] = request.templateVersion;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateStateConfiguration',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a desired-state configuration.
 *
 * @param request CreateStateConfigurationRequest
 * @return CreateStateConfigurationResponse
 */
async function createStateConfiguration(request: CreateStateConfigurationRequest): CreateStateConfigurationResponse {
  var runtime = new Util.RuntimeOptions{};
  return createStateConfigurationWithOptions(request, runtime);
}

model CreateTemplateRequest {
  content?: string(name='Content', description='The content of the template. The content must be in the JSON or YAML format, and its maximum size is 64 KB.

This parameter is required.', example='{"FormatVersion": "OOS-2019-06-01", "Description": "Describe instances of given status", "Parameters": {"Status": {"Type": "String", "Description": "(Required) The status of the Ecs instance."}}, "Tasks": [{"Properties": {"Parameters": {"Status": "{{ Status }}"}, "API": "DescribeInstances", "Service": "Ecs"}, "Name": "foo", "Action": "ACS::ExecuteApi"}]}'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
  tags?: map[string]any(name='Tags', description='The tag keys and tag values. The number of key-value pairs ranges from 1 to 20.', example='{"k1":"v1","k2":"v2"}'),
  templateName?: string(name='TemplateName', description='The name of the template. The name can be 1 to 200 characters in length and can contain letters, digits, hyphens (-), and underscores (_). The name cannot start with ALIYUN, ACS, ALIBABA, or ALICLOUD.

This parameter is required.', example='MyTemplate'),
  versionName?: string(name='VersionName', description='The name of the version of the template.', example='v2'),
}

model CreateTemplateShrinkRequest {
  content?: string(name='Content', description='The content of the template. The content must be in the JSON or YAML format, and its maximum size is 64 KB.

This parameter is required.', example='{"FormatVersion": "OOS-2019-06-01", "Description": "Describe instances of given status", "Parameters": {"Status": {"Type": "String", "Description": "(Required) The status of the Ecs instance."}}, "Tasks": [{"Properties": {"Parameters": {"Status": "{{ Status }}"}, "API": "DescribeInstances", "Service": "Ecs"}, "Name": "foo", "Action": "ACS::ExecuteApi"}]}'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
  tagsShrink?: string(name='Tags', description='The tag keys and tag values. The number of key-value pairs ranges from 1 to 20.', example='{"k1":"v1","k2":"v2"}'),
  templateName?: string(name='TemplateName', description='The name of the template. The name can be 1 to 200 characters in length and can contain letters, digits, hyphens (-), and underscores (_). The name cannot start with ALIYUN, ACS, ALIBABA, or ALICLOUD.

This parameter is required.', example='MyTemplate'),
  versionName?: string(name='VersionName', description='The name of the version of the template.', example='v2'),
}

model CreateTemplateResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='20758A-585D-4A41-A9B2-28DA8F4F534F'),
  template?: {
    createdBy?: string(name='CreatedBy', description='The creator of the template.', example='root(13090000)'),
    createdDate?: string(name='CreatedDate', description='The time when the template was created.', example='2019-05-16T10:26:14Z'),
    description?: string(name='Description', description='The description of the template.', example='Describe instances of given status'),
    hasTrigger?: boolean(name='HasTrigger', description='Indicates whether the template was configured with a trigger.', example='true'),
    hash?: string(name='Hash', description='The SHA-256 value of the template content.', example='4bc7d7a21b3e003434b9c223f6e6d2578b5ebfeb5be28c1fcf8a8a1b11907bb4'),
    resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
    shareType?: string(name='ShareType', description='The share type of the template. The share type of the template that you create is Private.', example='Private'),
    tags?: map[string]any(name='Tags', description='The tags of the resources.', example='{     "k1":"v1",     "k2":"v2" }'),
    templateFormat?: string(name='TemplateFormat', description='The format of the template. The system automatically determines whether the format is JSON or YAML.', example='JSON'),
    templateId?: string(name='TemplateId', description='The ID of the template.', example='t-94753d38'),
    templateName?: string(name='TemplateName', description='The name of the template.', example='MyTemplate'),
    templateVersion?: string(name='TemplateVersion', description='The version of the template. The name of the version consists of the letter v and a number. The number starts from 1.', example='v1'),
    updatedBy?: string(name='UpdatedBy', description='The Alibaba Cloud account that last modified the information about the template.', example='root(130900000)'),
    updatedDate?: string(name='UpdatedDate', description='The time when the template was last updated.', example='2019-05-16T10:26:14Z'),
  }(name='Template', description='The metadata of the template.'),
  templateType?: string(name='TemplateType', description='The type of the template.', example='Private'),
}

model CreateTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateTemplateResponseBody(name='body'),
}

/**
 * @summary Creates a template.
 *
 * @param tmpReq CreateTemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateTemplateResponse
 */
async function createTemplateWithOptions(tmpReq: CreateTemplateRequest, runtime: Util.RuntimeOptions): CreateTemplateResponse {
  Util.validateModel(tmpReq);
  var request = new CreateTemplateShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.tags)) {
    request.tagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tags, 'Tags', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.content)) {
    query['Content'] = request.content;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.tagsShrink)) {
    query['Tags'] = request.tagsShrink;
  }
  if (!Util.isUnset(request.templateName)) {
    query['TemplateName'] = request.templateName;
  }
  if (!Util.isUnset(request.versionName)) {
    query['VersionName'] = request.versionName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateTemplate',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a template.
 *
 * @param request CreateTemplateRequest
 * @return CreateTemplateResponse
 */
async function createTemplate(request: CreateTemplateRequest): CreateTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  return createTemplateWithOptions(request, runtime);
}

model DeleteApplicationRequest {
  force?: boolean(name='Force', description='Specifies whether to forcibly delete the application. Valid values:

*   true
*   false', example='False'),
  name?: string(name='Name', description='The application name.

This parameter is required.', example='MyApplication'),
  regionId?: string(name='RegionId', description='The region ID. Set the value to cn-hangzhou.', example='cn-hangzhou'),
  retainResource?: boolean(name='RetainResource', description='Specifies whether to retain resources created by application manager when deleting the application. Valid values:
- true
- false', example='false'),
}

model DeleteApplicationResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='37A9F0FD-51D0-58D5-B91F-DF570281556B'),
}

model DeleteApplicationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteApplicationResponseBody(name='body'),
}

/**
 * @summary Deletes an application. You can call this operation only for the applications that reside in the China (Hangzhou) region. Use an endpoint of the China (Hangzhou) region.
 *
 * @param request DeleteApplicationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteApplicationResponse
 */
async function deleteApplicationWithOptions(request: DeleteApplicationRequest, runtime: Util.RuntimeOptions): DeleteApplicationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.force)) {
    query['Force'] = request.force;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.retainResource)) {
    query['RetainResource'] = request.retainResource;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteApplication',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes an application. You can call this operation only for the applications that reside in the China (Hangzhou) region. Use an endpoint of the China (Hangzhou) region.
 *
 * @param request DeleteApplicationRequest
 * @return DeleteApplicationResponse
 */
async function deleteApplication(request: DeleteApplicationRequest): DeleteApplicationResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteApplicationWithOptions(request, runtime);
}

model DeleteApplicationGroupRequest {
  applicationName?: string(name='ApplicationName', description='The name of the application.

This parameter is required.', example='MyApplication'),
  name?: string(name='Name', description='The name of the application group.

This parameter is required.', example='MyApplicationGroup'),
  regionId?: string(name='RegionId', description='The ID of the region. Set the value to cn-hangzhou.', example='cn-hangzhou'),
  retainResource?: boolean(name='RetainResource', description='Specifies whether to retain resources created by application manager when deleting the application. Valid values:
- true
- false', example='false'),
}

model DeleteApplicationGroupResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='9E011F98-4EE5-5E3A-8FA3-D38F2C531C1F'),
}

model DeleteApplicationGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteApplicationGroupResponseBody(name='body'),
}

/**
 * @summary Deletes an application group. You can call this operation only for the application groups which reside in the China (Hangzhou) region. Use an endpoint of the China (Hangzhou) region.
 *
 * @param request DeleteApplicationGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteApplicationGroupResponse
 */
async function deleteApplicationGroupWithOptions(request: DeleteApplicationGroupRequest, runtime: Util.RuntimeOptions): DeleteApplicationGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.applicationName)) {
    query['ApplicationName'] = request.applicationName;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.retainResource)) {
    query['RetainResource'] = request.retainResource;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteApplicationGroup',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes an application group. You can call this operation only for the application groups which reside in the China (Hangzhou) region. Use an endpoint of the China (Hangzhou) region.
 *
 * @param request DeleteApplicationGroupRequest
 * @return DeleteApplicationGroupResponse
 */
async function deleteApplicationGroup(request: DeleteApplicationGroupRequest): DeleteApplicationGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteApplicationGroupWithOptions(request, runtime);
}

model DeleteExecutionsRequest {
  executionIds?: string(name='ExecutionIds', description='The execution IDs.

You can specify multiple execution IDs in a JSON array in the format of `["xxxxxxxxx", "yyyyyyyyy", ... "zzzzzzzzz"]`. You can specify up to 100 execution IDs at a time. Separate multiple IDs with commas (,).

This parameter is required.', example='["exec-xxx"]'),
  force?: boolean(name='Force', description='Whether to force delete the running task, the default value is false.', example='false'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
}

model DeleteExecutionsResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='491DF8C2-34C9-4679-9DB3-4C0F49B129AC'),
}

model DeleteExecutionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteExecutionsResponseBody(name='body'),
}

/**
 * @summary Deletes multiple executions.
 *
 * @param request DeleteExecutionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteExecutionsResponse
 */
async function deleteExecutionsWithOptions(request: DeleteExecutionsRequest, runtime: Util.RuntimeOptions): DeleteExecutionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.executionIds)) {
    query['ExecutionIds'] = request.executionIds;
  }
  if (!Util.isUnset(request.force)) {
    query['Force'] = request.force;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteExecutions',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes multiple executions.
 *
 * @param request DeleteExecutionsRequest
 * @return DeleteExecutionsResponse
 */
async function deleteExecutions(request: DeleteExecutionsRequest): DeleteExecutionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteExecutionsWithOptions(request, runtime);
}

model DeleteOpsItemsRequest {
  opsItemIds?: [ string ](name='OpsItemIds', description='The IDs of O\\\\&M items.'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
}

model DeleteOpsItemsResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='DBA6E6C8-F75D-41DE-AFF5-1FA03F551CA3'),
}

model DeleteOpsItemsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteOpsItemsResponseBody(name='body'),
}

/**
 * @summary Deletes O\\\\\\&M Items.
 *
 * @param request DeleteOpsItemsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteOpsItemsResponse
 */
async function deleteOpsItemsWithOptions(request: DeleteOpsItemsRequest, runtime: Util.RuntimeOptions): DeleteOpsItemsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.opsItemIds)) {
    query['OpsItemIds'] = request.opsItemIds;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteOpsItems',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes O\\\\\\&M Items.
 *
 * @param request DeleteOpsItemsRequest
 * @return DeleteOpsItemsResponse
 */
async function deleteOpsItems(request: DeleteOpsItemsRequest): DeleteOpsItemsResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteOpsItemsWithOptions(request, runtime);
}

model DeleteParameterRequest {
  name?: string(name='Name', description='The name of the common parameter. The name can be up to 180 characters in length and can contain only letters, digits, hyphens (-), and underscores (_). It cannot start with aliyun, acs, alibaba, alicloud, or oos.

This parameter is required.', example='MyParameter'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
}

model DeleteParameterResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='C0D02BDF-77F6-49F2-95C9-8E87121D2979'),
}

model DeleteParameterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteParameterResponseBody(name='body'),
}

/**
 * @summary Deletes a common parameter.
 *
 * @param request DeleteParameterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteParameterResponse
 */
async function deleteParameterWithOptions(request: DeleteParameterRequest, runtime: Util.RuntimeOptions): DeleteParameterResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteParameter',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a common parameter.
 *
 * @param request DeleteParameterRequest
 * @return DeleteParameterResponse
 */
async function deleteParameter(request: DeleteParameterRequest): DeleteParameterResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteParameterWithOptions(request, runtime);
}

model DeletePatchBaselineRequest {
  name?: string(name='Name', description='The name of the patch baseline.

This parameter is required.', example='MyPatchBaseline'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
}

model DeletePatchBaselineResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='85197066-0209-5775-BBED-99DF9DA44E48'),
}

model DeletePatchBaselineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeletePatchBaselineResponseBody(name='body'),
}

/**
 * @summary Deletes a patch baseline.
 *
 * @param request DeletePatchBaselineRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeletePatchBaselineResponse
 */
async function deletePatchBaselineWithOptions(request: DeletePatchBaselineRequest, runtime: Util.RuntimeOptions): DeletePatchBaselineResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeletePatchBaseline',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a patch baseline.
 *
 * @param request DeletePatchBaselineRequest
 * @return DeletePatchBaselineResponse
 */
async function deletePatchBaseline(request: DeletePatchBaselineRequest): DeletePatchBaselineResponse {
  var runtime = new Util.RuntimeOptions{};
  return deletePatchBaselineWithOptions(request, runtime);
}

model DeleteSecretParameterRequest {
  name?: string(name='Name', description='The name of the encryption parameter. The name must be 1 to 180 characters in length and can contain letters, digits, hyphens (-), and underscores (_). It cannot start with ALIYUN, ACS, ALIBABA, ALICLOUD, or OOS.

This parameter is required.', example='MySecretParameter'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
}

model DeleteSecretParameterResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='C0D02BDF-77F6-49F2-95C9-8E87121D1944'),
}

model DeleteSecretParameterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteSecretParameterResponseBody(name='body'),
}

/**
 * @summary Deletes an encryption parameter. Make sure that you have the permissions to call the DeleteSecret operation before you call this operation.
 *
 * @param request DeleteSecretParameterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteSecretParameterResponse
 */
async function deleteSecretParameterWithOptions(request: DeleteSecretParameterRequest, runtime: Util.RuntimeOptions): DeleteSecretParameterResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteSecretParameter',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes an encryption parameter. Make sure that you have the permissions to call the DeleteSecret operation before you call this operation.
 *
 * @param request DeleteSecretParameterRequest
 * @return DeleteSecretParameterResponse
 */
async function deleteSecretParameter(request: DeleteSecretParameterRequest): DeleteSecretParameterResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteSecretParameterWithOptions(request, runtime);
}

model DeleteStateConfigurationsRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.', example='abcde3OARpx77No54nv6'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  stateConfigurationIds?: string(name='StateConfigurationIds', description='The IDs of desired-state configurations.

This parameter is required.', example='["sc-asfgdhj12345"]'),
}

model DeleteStateConfigurationsResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='12345B731-0FCE-48BA-8D42-605abcde'),
}

model DeleteStateConfigurationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteStateConfigurationsResponseBody(name='body'),
}

/**
 * @summary Deletes multiple desired-state configurations at a time.
 *
 * @param request DeleteStateConfigurationsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteStateConfigurationsResponse
 */
async function deleteStateConfigurationsWithOptions(request: DeleteStateConfigurationsRequest, runtime: Util.RuntimeOptions): DeleteStateConfigurationsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.stateConfigurationIds)) {
    query['StateConfigurationIds'] = request.stateConfigurationIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteStateConfigurations',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes multiple desired-state configurations at a time.
 *
 * @param request DeleteStateConfigurationsRequest
 * @return DeleteStateConfigurationsResponse
 */
async function deleteStateConfigurations(request: DeleteStateConfigurationsRequest): DeleteStateConfigurationsResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteStateConfigurationsWithOptions(request, runtime);
}

model DeleteTemplateRequest {
  autoDeleteExecutions?: boolean(name='AutoDeleteExecutions', description='Specifies whether to delete the related executions when a template is deleted.', example='false'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  templateName?: string(name='TemplateName', description='The name of the template. The name can be 1 to 200 characters in length and can contain letters, digits, hyphens (-), and underscores (_). It cannot start with ALIYUN, ACS, ALIBABA, or ALICLOUD.

This parameter is required.', example='MyTemplate'),
}

model DeleteTemplateResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='2075899A-585D-4A41-A9B2-28DA8534F'),
}

model DeleteTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteTemplateResponseBody(name='body'),
}

/**
 * @summary Deletes a template.
 *
 * @param request DeleteTemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteTemplateResponse
 */
async function deleteTemplateWithOptions(request: DeleteTemplateRequest, runtime: Util.RuntimeOptions): DeleteTemplateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.autoDeleteExecutions)) {
    query['AutoDeleteExecutions'] = request.autoDeleteExecutions;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.templateName)) {
    query['TemplateName'] = request.templateName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteTemplate',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a template.
 *
 * @param request DeleteTemplateRequest
 * @return DeleteTemplateResponse
 */
async function deleteTemplate(request: DeleteTemplateRequest): DeleteTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteTemplateWithOptions(request, runtime);
}

model DeleteTemplatesRequest {
  autoDeleteExecutions?: boolean(name='AutoDeleteExecutions', description='Specifies whether to delete the related executions when a template is deleted.', example='false'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  templateNames?: string(name='TemplateNames', description='The names of the templates to be deleted.

This parameter is required.', example='["t1","t2"]'),
}

model DeleteTemplatesResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='2075899A-585D-4A41-A9B2-28DA8534'),
}

model DeleteTemplatesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteTemplatesResponseBody(name='body'),
}

/**
 * @summary Deletes multiple templates.
 *
 * @param request DeleteTemplatesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteTemplatesResponse
 */
async function deleteTemplatesWithOptions(request: DeleteTemplatesRequest, runtime: Util.RuntimeOptions): DeleteTemplatesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.autoDeleteExecutions)) {
    query['AutoDeleteExecutions'] = request.autoDeleteExecutions;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.templateNames)) {
    query['TemplateNames'] = request.templateNames;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteTemplates',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes multiple templates.
 *
 * @param request DeleteTemplatesRequest
 * @return DeleteTemplatesResponse
 */
async function deleteTemplates(request: DeleteTemplatesRequest): DeleteTemplatesResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteTemplatesWithOptions(request, runtime);
}

model DeployApplicationGroupRequest {
  applicationName?: string(name='ApplicationName', description='The name of the application.

This parameter is required.', example='MyApplication'),
  deployParameters?: string(name='DeployParameters', description='The deployment information about the application group.

This parameter is required.', example='{       "TemplateURL": "https://ros-template.oss-cn-zhangjiakou.aliyuncs.com/App_Management_Existing_Vpc_Ecs_Instance.json",       "Parameters": {         "ZoneId": "cn-hangzhou-k",         "ProjectName": "test",         "SystemDiskSize": 40,         "InstanceChargeType": "PostPaid",         "SecurityGroupId": "sg-bp1a4374akk63jl8tddy",         "VSwitchId": "vsw-bp1fcvc3zn0jrag86rrlm",         "SystemDiskCategory": "cloud_essd",         "InstancePassword": "******",         "InternetChargeType": "PayByTraffic",         "InstanceCount": 1,         "InternetMaxBandwidthOut": 0,         "VpcId": "vpc-bp1i99boyas8i8m9t3skp",         "EcsImageId": "centos_8_5_x64_20G_alibase_20211228.vhd",         "DataDiskSize": 100,         "EcsInstanceType": "ecs.s6-c1m4.small",         "DataDiskCategory": "cloud_efficiency",         "EnvironmentCommandId": "c-hz028fc3g031gcg"       }'),
  name?: string(name='Name', description='The name of the application group.

This parameter is required.', example='MyApplicationGroup'),
  regionId?: string(name='RegionId', description='The ID of the region in which you want to deploy the application group.', example='cn-hangzhou'),
}

model DeployApplicationGroupResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='8AF4800A-A316-589A-90C4-313B1FEEB084'),
}

model DeployApplicationGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeployApplicationGroupResponseBody(name='body'),
}

/**
 * @summary Deploys an application group. You can call this operation only for the applications which reside in the China (Hangzhou) region. Use an endpoint of the China (Hangzhou) region.
 *
 * @param request DeployApplicationGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeployApplicationGroupResponse
 */
async function deployApplicationGroupWithOptions(request: DeployApplicationGroupRequest, runtime: Util.RuntimeOptions): DeployApplicationGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.applicationName)) {
    query['ApplicationName'] = request.applicationName;
  }
  if (!Util.isUnset(request.deployParameters)) {
    query['DeployParameters'] = request.deployParameters;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeployApplicationGroup',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deploys an application group. You can call this operation only for the applications which reside in the China (Hangzhou) region. Use an endpoint of the China (Hangzhou) region.
 *
 * @param request DeployApplicationGroupRequest
 * @return DeployApplicationGroupResponse
 */
async function deployApplicationGroup(request: DeployApplicationGroupRequest): DeployApplicationGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return deployApplicationGroupWithOptions(request, runtime);
}

model DescribeApplicationGroupBillRequest {
  applicationName?: string(name='ApplicationName', description='The application name.

This parameter is required.', example='test_application'),
  billingCycle?: string(name='BillingCycle', description='The billing cycle, in the YYYY-MM format.

This parameter is required.', example='2023-06'),
  maxResults?: int32(name='MaxResults', description='The number of entries per page.', example='10'),
  name?: string(name='Name', description='The application group name.

This parameter is required.', example='test_application_group'),
  nextToken?: string(name='NextToken', description='The token that is used to retrieve the next page of results.', example='-'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
  resourceType?: string(name='ResourceType', description='The type of the cloud resource.

This parameter is required.', example='ALIYUN::ECS::INSTANCE'),
}

model DescribeApplicationGroupBillResponseBody = {
  applicationGroupConsume?: [ 
    {
      amount?: float(name='Amount', description='The amount consumed by the instance.', example='18.88'),
      creationTime?: string(name='CreationTime', description='The time when the instance was created.', example='2023-06-10T06:00Z'),
      currency?: string(name='Currency', description='The currency unit.', example='CNY'),
      instanceId?: string(name='InstanceId', description='The ID of the instance.', example='i-0jl781czrhqey0s5zpsj'),
      instanceName?: string(name='InstanceName', description='The name of the instance.', example='test-'),
      instanceType?: string(name='InstanceType', description='The instance type.', example='ALIYUN::ECS::INSTANCE'),
      optimization?: string(name='Optimization', description='Optimization suggestions.', example='1'),
      peakType?: string(name='PeakType', description='The peak type.', example='WHITE'),
      performance?: string(name='Performance', description='The performance of the data synchronization instance.', example='"{\\\\"mem\\\\":\\\\"6.82\\\\",\\\\"cpu\\\\":\\\\"0.55\\\\"}"'),
      status?: string(name='Status', description='The status of instance.', example='Running'),
    }
  ](name='ApplicationGroupConsume', description='The consume of application group.'),
  maxResults?: int32(name='MaxResults', description='The number of entries per page.', example='10'),
  nextToken?: string(name='NextToken', description='The token that is used to retrieve the next page of results.', example='""'),
  requestId?: string(name='RequestId', description='The request ID.', example='E897A1AB-4701-5B71-93AD-38FD703763A3'),
}

model DescribeApplicationGroupBillResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeApplicationGroupBillResponseBody(name='body'),
}

/**
 * @summary 查询应用分组资源成本
 *
 * @param request DescribeApplicationGroupBillRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeApplicationGroupBillResponse
 */
async function describeApplicationGroupBillWithOptions(request: DescribeApplicationGroupBillRequest, runtime: Util.RuntimeOptions): DescribeApplicationGroupBillResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.applicationName)) {
    query['ApplicationName'] = request.applicationName;
  }
  if (!Util.isUnset(request.billingCycle)) {
    query['BillingCycle'] = request.billingCycle;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApplicationGroupBill',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询应用分组资源成本
 *
 * @param request DescribeApplicationGroupBillRequest
 * @return DescribeApplicationGroupBillResponse
 */
async function describeApplicationGroupBill(request: DescribeApplicationGroupBillRequest): DescribeApplicationGroupBillResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeApplicationGroupBillWithOptions(request, runtime);
}

model DescribeRegionsRequest {
  acceptLanguage?: string(name='AcceptLanguage', description='The supported natural language. Valid values:

*   zh-CN: Chinese
*   en-US: English', example='zh-CN'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
}

model DescribeRegionsResponseBody = {
  regions?: [ 
    {
      localName?: string(name='LocalName', description='The name of the region.', example='China (Shenzhen)'),
      regionEndpoint?: string(name='RegionEndpoint', description='The endpoint of the region.', example='oos.cn-shenzhen.aliyuncs.com'),
      regionId?: string(name='RegionId', description='The region ID.', example='cn-shenzhen'),
    }
  ](name='Regions', description='The details of the regions.'),
  requestId?: string(name='RequestId', description='The request ID.', example='469E79B1-90A3-4A57-B7C4-2FE0C8B5175E'),
}

model DescribeRegionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRegionsResponseBody(name='body'),
}

/**
 * @summary Queries supported regions.
 *
 * @param request DescribeRegionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRegionsResponse
 */
async function describeRegionsWithOptions(request: DescribeRegionsRequest, runtime: Util.RuntimeOptions): DescribeRegionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceptLanguage)) {
    query['AcceptLanguage'] = request.acceptLanguage;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeRegions',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries supported regions.
 *
 * @param request DescribeRegionsRequest
 * @return DescribeRegionsResponse
 */
async function describeRegions(request: DescribeRegionsRequest): DescribeRegionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRegionsWithOptions(request, runtime);
}

model GenerateExecutionPolicyRequest {
  ramRole?: string(name='RamRole', description='The RAM role.', example='AliyunServiceRoleForOOSBandwidthScheduler'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
  templateContent?: string(name='TemplateContent', description='The content of the template in the JSON or YAML format. This parameter is the same as the Content parameter that you can specify when you call the CreateTemplate operation. You can use this parameter to specify the tasks that you want to run. This way, you do not need to create a template before you start an execution. If you select an existing template, you do not need to specify this parameter.', example='{   "Description": "Example template, describe instances in some status",   "FormatVersion": "OOS-2019-06-01",   "Parameters": {},   "Tasks": [     {       "Name": "describeInstances",       "Action": "ACS::ExecuteAPI",       "Description": "desc-en",       "Properties": {         "Service": "ECS",         "API": "DescribeInstances",         "Parameters": {           "Status": "Running"         }       }     }   ] }'),
  templateName?: string(name='TemplateName', description='The name of the template.', example='vmeixme'),
  templateVersion?: string(name='TemplateVersion', description='The version of the template. The default value is the latest version of the template.', example='v2'),
}

model GenerateExecutionPolicyResponseBody = {
  missingPolicy?: string(name='MissingPolicy', description='The policies that are missing.', example='[{\\\\"Action\\\\": [\\\\"ecs:DescribeInvocationResults\\\\", \\\\"ecs:DescribeInstances\\\\", \\\\"ecs:RunCommand\\\\", \\\\"ecs:DescribeInvocations\\\\"], \\\\"ServiceName\\\\": \\\\"ecs\\\\", \\\\"Resources\\\\": \\\\"*\\\\"}]'),
  policy?: string(name='Policy', description='The RAM policy.', example='{}'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='14A07460-EBE7-47CA-9757-12CC4761D47A'),
}

model GenerateExecutionPolicyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GenerateExecutionPolicyResponseBody(name='body'),
}

/**
 * @summary Queries the Resource Access Management (RAM) policy required for template execution.
 *
 * @param request GenerateExecutionPolicyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GenerateExecutionPolicyResponse
 */
async function generateExecutionPolicyWithOptions(request: GenerateExecutionPolicyRequest, runtime: Util.RuntimeOptions): GenerateExecutionPolicyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ramRole)) {
    query['RamRole'] = request.ramRole;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.templateContent)) {
    query['TemplateContent'] = request.templateContent;
  }
  if (!Util.isUnset(request.templateName)) {
    query['TemplateName'] = request.templateName;
  }
  if (!Util.isUnset(request.templateVersion)) {
    query['TemplateVersion'] = request.templateVersion;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GenerateExecutionPolicy',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the Resource Access Management (RAM) policy required for template execution.
 *
 * @param request GenerateExecutionPolicyRequest
 * @return GenerateExecutionPolicyResponse
 */
async function generateExecutionPolicy(request: GenerateExecutionPolicyRequest): GenerateExecutionPolicyResponse {
  var runtime = new Util.RuntimeOptions{};
  return generateExecutionPolicyWithOptions(request, runtime);
}

model GenerateOpsItemRequest {
  clientToken?: string(name='ClientToken', description='The token that is used to ensure the idempotency.', example='123e4567-e89b-12d3-a456-42665544****'),
  configurationId?: string(name='ConfigurationId', description='The configuration ID of the O\\\\&M item.', example='oic-ae4f******2c682e3'),
  data?: string(name='Data', description='The source system data.

This parameter is required.', example='/aliyun/ecs'),
  dataSource?: string(name='DataSource', description='The data source system.', example='/aliyun/eventbridge/event'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
}

model GenerateOpsItemResponseBody = {
  opsItemIds?: [ string ](name='OpsItemIds', description='The O\\\\&M item list.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='DA4F08D4-DA54-5407-84B9-108C71D75B17'),
}

model GenerateOpsItemResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GenerateOpsItemResponseBody(name='body'),
}

/**
 * @summary Generates an O\\\\\\&M item.
 *
 * @param request GenerateOpsItemRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GenerateOpsItemResponse
 */
async function generateOpsItemWithOptions(request: GenerateOpsItemRequest, runtime: Util.RuntimeOptions): GenerateOpsItemResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.configurationId)) {
    query['ConfigurationId'] = request.configurationId;
  }
  if (!Util.isUnset(request.data)) {
    query['Data'] = request.data;
  }
  if (!Util.isUnset(request.dataSource)) {
    query['DataSource'] = request.dataSource;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GenerateOpsItem',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Generates an O\\\\\\&M item.
 *
 * @param request GenerateOpsItemRequest
 * @return GenerateOpsItemResponse
 */
async function generateOpsItem(request: GenerateOpsItemRequest): GenerateOpsItemResponse {
  var runtime = new Util.RuntimeOptions{};
  return generateOpsItemWithOptions(request, runtime);
}

model GetApplicationRequest {
  name?: string(name='Name', description='The application name.

This parameter is required.', example='MyApplication'),
  regionId?: string(name='RegionId', description='The region ID. Set the value to cn-hangzhou.', example='cn-hangzhou'),
}

model GetApplicationResponseBody = {
  application?: {
    alarmConfig?: {
      contactGroups?: [ string ](name='ContactGroups', description='The alert contact list.'),
      healthCheckUrl?: string(name='HealthCheckUrl', description='The health check URL of the application.', example='/api/health/'),
      templateIds?: [ string ](name='TemplateIds', description='The ID of the alert template.'),
    }(name='AlarmConfig', description='The configurations of application alerts.'),
    applicationSource?: string(name='ApplicationSource', description='The source of application.', example='{"Platform":"gitee","Owner":"aliyun-computenest","RepoName":"aliyun-computenest/java-springboot-demo","Name":"java-springboot-demo"}'),
    applicationType?: string(name='ApplicationType', description='The type of the application.

Valid values:

*   ComputeNest

    <!-- -->

    <!-- -->

    <!-- -->

*   Custom

    <!-- -->

    <!-- -->

    <!-- -->

*   DingTalk

    <!-- -->

    <!-- -->

    <!-- -->', example='DingTalk'),
    createDate?: string(name='CreateDate', description='The time when the application was created.', example='2021-09-07T09:17:46Z'),
    description?: string(name='Description', description='The description of the application.', example='Application'),
    name?: string(name='Name', description='The application name.', example='MyApplication'),
    resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m******'),
    serviceId?: string(name='ServiceId', description='The ID of the Compute Nest service that corresponds to the application template.', example='service-79538e30e44541b699d8'),
    tags?: map[string]any(name='Tags', description='The tags.', example='{"k1": "v1", "k2": "v2"}'),
    updateDate?: string(name='UpdateDate', description='The time when the application was updated.', example='2021-09-07T09:17:46Z'),
  }(name='Application', description='The information about the application.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='51004B8A-6D9A-5ACB-9158-6C6794496AD0'),
}

model GetApplicationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetApplicationResponseBody(name='body'),
}

/**
 * @summary Queries the information of an application. You can call this operation only for the applications that reside in the China (Hangzhou) region. Use an endpoint of the China (Hangzhou) region.
 *
 * @param request GetApplicationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetApplicationResponse
 */
async function getApplicationWithOptions(request: GetApplicationRequest, runtime: Util.RuntimeOptions): GetApplicationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetApplication',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information of an application. You can call this operation only for the applications that reside in the China (Hangzhou) region. Use an endpoint of the China (Hangzhou) region.
 *
 * @param request GetApplicationRequest
 * @return GetApplicationResponse
 */
async function getApplication(request: GetApplicationRequest): GetApplicationResponse {
  var runtime = new Util.RuntimeOptions{};
  return getApplicationWithOptions(request, runtime);
}

model GetApplicationGroupRequest {
  applicationName?: string(name='ApplicationName', description='The name of the application.

This parameter is required.', example='MyApplication'),
  name?: string(name='Name', description='The name of the application group.

This parameter is required.', example='MyApplicationGroup'),
  regionId?: string(name='RegionId', description='The ID of the region. Set the value to cn-hangzhou.', example='cn-hangzhou'),
}

model GetApplicationGroupResponseBody = {
  applicationGroup?: {
    applicationName?: string(name='ApplicationName', description='The name of the application.', example='MyApplication'),
    applicationSource?: string(name='ApplicationSource', description='The source of application.', example='{"Platform":"github","RepoName":"wenle/springboot-ecs-sourcecode-demo","Owner":"wenle","Branch":"main","CommitHash":"8559ff3ac7568fc7951ff63f841883ee3f06c6fe","CommitMessage":"Init computenest project"}'),
    cmsGroupId?: string(name='CmsGroupId', description='The ID of the application group in CloudMonitor.', example='12345678'),
    createDate?: string(name='CreateDate', description='The time when the application group was created.', example='2021-09-07T10:28:25Z'),
    deployOutputs?: string(name='DeployOutputs', description='The output of the deployment result.', example='{       "Outputs": [         {           "Description": "No description given",           "OutputKey": "InstanceIds"         }       ],       "StackId": "6ef4b860-f6e7-4145-8d22-f4a2a32363e1"     }   }'),
    deployParameters?: string(name='DeployParameters', description='The configuration information of the application group.', example='{       "TemplateURL": "https://ros-template.oss-cn-zhangjiakou.aliyuncs.com/App_Management_Existing_Vpc_Ecs_Instance.json",       "Parameters": {         "ZoneId": "cn-hangzhou-k",         "ProjectName": "test",         "SystemDiskSize": 40,         "InstanceChargeType": "PostPaid",         "SecurityGroupId": "sg-bp1a4374akk63jl8tddy",         "VSwitchId": "vsw-bp1fcvc3zn0jrag86rrlm",         "SystemDiskCategory": "cloud_essd",         "InstancePassword": "******",         "InternetChargeType": "PayByTraffic",         "InstanceCount": 1,         "InternetMaxBandwidthOut": 0,         "VpcId": "vpc-bp1i99boyas8i8m9t3skp",         "EcsImageId": "centos_8_5_x64_20G_alibase_20211228.vhd",         "DataDiskSize": 100,         "EcsInstanceType": "ecs.s6-c1m4.small",         "DataDiskCategory": "cloud_efficiency",         "EnvironmentCommandId": "c-hz028fc3g031gcg"       }'),
    deployRegionId?: string(name='DeployRegionId', description='The ID of the region in which you deploy the application group.', example='cn-hangzhou'),
    description?: string(name='Description', description='The description of the application group.', example='ApplicationGroup'),
    importTagKey?: string(name='ImportTagKey', description='The tag key.', example='k1'),
    importTagValue?: string(name='ImportTagValue', description='The tag value.', example='v1'),
    name?: string(name='Name', description='The name of the application group.', example='MyApplicationGroup'),
    operationMetadata?: string(name='OperationMetadata', description='The hosted O\\\\&M configurations.', example='{\\\\\\\\"PrometheusConfigMap\\\\\\\\":{\\\\\\\\"Template 1\\\\\\\\":{\\\\\\\\"EnablePrometheus\\\\\\\\":false}}}'),
    progress?: string(name='Progress', description='The creation progress of the application instance.', example='100'),
    status?: string(name='Status', description='The state of the application group.', example='Created'),
    statusReason?: string(name='StatusReason', description='The state information of the application group.', example='Stack CREATE completed successfully'),
    updateDate?: string(name='UpdateDate', description='The time when the application group was last modified.', example='2021-09-07T10:28:25Z'),
  }(name='ApplicationGroup', description='The information about the application group.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='92EA60ED-544D-55E9-93D9-237BE9976C0D'),
}

model GetApplicationGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetApplicationGroupResponseBody(name='body'),
}

/**
 * @summary Queries the information about an application group. You can call this operation only for the application groups that reside in the China (Hangzhou) region. Use an endpoint of the China (Hangzhou) region.
 *
 * @param request GetApplicationGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetApplicationGroupResponse
 */
async function getApplicationGroupWithOptions(request: GetApplicationGroupRequest, runtime: Util.RuntimeOptions): GetApplicationGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.applicationName)) {
    query['ApplicationName'] = request.applicationName;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetApplicationGroup',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about an application group. You can call this operation only for the application groups that reside in the China (Hangzhou) region. Use an endpoint of the China (Hangzhou) region.
 *
 * @param request GetApplicationGroupRequest
 * @return GetApplicationGroupResponse
 */
async function getApplicationGroup(request: GetApplicationGroupRequest): GetApplicationGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return getApplicationGroupWithOptions(request, runtime);
}

model GetExecutionTemplateRequest {
  executionId?: string(name='ExecutionId', description='The ID of the execution.

This parameter is required.', example='exec-046490ff88f242'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
}

model GetExecutionTemplateResponseBody = {
  content?: string(name='Content', description='The content of the template.', example='"{\\\\n \\\\"FormatVersion\\\\": \\\\"OOS-2019-06-01\\\\",\\\\n \\\\"Parameters\\\\": {\\\\n \\\\"Status\\\\": {\\\\n \\\\"Type\\\\": \\\\"String\\\\",\\\\n \\\\"Description\\\\": \\\\"(Required) The ID of the ECS instance.\\\\"\\\\n }\\\\n },\\\\n \\\\"Tasks\\\\": [\\\\n {\\\\n \\\\"Name\\\\": \\\\"bar\\\\",\\\\n \\\\"Properties\\\\": {\\\\n \\\\"Parameters\\\\": {\\\\n \\\\"Status\\\\": \\\\"{{ Status }}\\\\"\\\\n },\\\\n \\\\"API\\\\": \\\\"DescribeInstances\\\\",\\\\n \\\\"Service\\\\": \\\\"Ecs\\\\"\\\\n },\\\\n \\\\"Action\\\\": \\\\"acs::ExecuteAPI\\\\",\\\\n \\\\"Outputs\\\\": {\\\\n \\\\"InstanceIds\\\\", {\\\\n \\\\"ValueSelector\\\\": \\\\".Instances.Instance[].InstanceId\\\\",\\\\n \\\\"Type\\\\": \\\\"List\\\\"\\\\n }\\\\n }\\\\n }\\\\n ],\\\\n \\\\"Outputs\\\\": {\\\\n \\\\"InstanceIds\\\\": {\\\\n \\\\"Value\\\\": \\\\" {{ bar.InstanceIds }} \\\\",\\\\n \\\\"Type\\\\": \\\\"List\\\\"\\\\n }\\\\n }\\\\n}\\\\n"'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='14A60-EBE7-47CA-9757-12C1D47A'),
  template?: {
    createdBy?: string(name='CreatedBy', description='The creator of the template.', example='root(13090000)'),
    createdDate?: string(name='CreatedDate', description='The time when the template was created.', example='2019-05-16T10:26:14Z'),
    description?: string(name='Description', description='The description of the template.', example='Get status of instances'),
    hash?: string(name='Hash', description='The SHA-256 value of the template content.', example='4bc7d7a21b3e003434b9c223f6e6d2578b5ebfeb5be28c1fcf8a8a1b11907bb4'),
    shareType?: string(name='ShareType', description='The share type of the template. The share type of a user-created template is **Private**.', example='Private'),
    tags?: map[string]any(name='Tags', description='The tag keys and values. The number of key-value pairs ranges from 1 to 20.', example='{"k1":"k2","k2":"v2"}'),
    templateFormat?: string(name='TemplateFormat', description='The format of the template. The system automatically determines whether the format is JSON or YAML.', example='JSON'),
    templateId?: string(name='TemplateId', description='The ID of the template.', example='t-94753d4d828d38'),
    templateName?: string(name='TemplateName', description='The name of the template.', example='MyTemplate'),
    templateVersion?: string(name='TemplateVersion', description='The version of the template. The name of the version consists of the letter v and a number. The number starts from 1.', example='v1'),
    updatedBy?: string(name='UpdatedBy', description='The user who last updated the template.', example='root(13090000)'),
    updatedDate?: string(name='UpdatedDate', description='The time when the template was last updated.', example='2019-05-16T10:26:14Z'),
  }(name='Template', description='The metadata of the template.'),
}

model GetExecutionTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetExecutionTemplateResponseBody(name='body'),
}

/**
 * @summary Queries the information about the template of an execution, including the content of the template.
 *
 * @param request GetExecutionTemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetExecutionTemplateResponse
 */
async function getExecutionTemplateWithOptions(request: GetExecutionTemplateRequest, runtime: Util.RuntimeOptions): GetExecutionTemplateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.executionId)) {
    query['ExecutionId'] = request.executionId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetExecutionTemplate',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about the template of an execution, including the content of the template.
 *
 * @param request GetExecutionTemplateRequest
 * @return GetExecutionTemplateResponse
 */
async function getExecutionTemplate(request: GetExecutionTemplateRequest): GetExecutionTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  return getExecutionTemplateWithOptions(request, runtime);
}

model GetInventorySchemaRequest {
  aggregator?: boolean(name='Aggregator', description='Specifies whether to return only properties that support the aggregate feature in the configuration list. Valid values:

*   true: only returns properties that support the aggregate feature in the configuration list.
*   false: returns all properties in the configuration list.', example='false'),
  maxResults?: int32(name='MaxResults', description='The number of entries per page. Valid values: 1 to 100. Default value: 50.', example='50'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results.', example='gAAAAABfh8MVLQI9AuKGACLgjbsXbWs-Mna47IDM6tr6wK7TZ1'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  typeName?: string(name='TypeName', description='The configuration list type name. Valid values:

*   ACS:InstanceInformation
*   ACS:Application
*   ACS:File
*   ACS:Network
*   ACS:WindowsRole
*   ACS:Service
*   ACS:WindowsUpdate
*   ACS:WindowsRegistry', example='ACS:Application'),
}

model GetInventorySchemaResponseBody = {
  maxResults?: string(name='MaxResults', description='The number of entries per page.', example='1'),
  nextToken?: string(name='NextToken', description='The pagination token that was used in the next request to retrieve a new page of results.', example='gAAAAABfh8MVLQI9AuKGACLgjbsXbWs-Mna47IDM6tr6wK7TZ1'),
  requestId?: string(name='RequestId', description='The request ID.', example='89117642-7167-4F4D-B7F1-876582279E3E'),
  schemas?: [ 
    {
      attributes?: [ 
        {
          dataType?: string(name='DataType', description='The data type of the property.', example='STRING'),
          name?: string(name='Name', description='The name of the property.', example='ApplicationType'),
        }
      ](name='Attributes', description='The properties of the configuration list.'),
      typeName?: string(name='TypeName', description='The name of the configuration list.', example='ACS:Application'),
      version?: string(name='Version', description='The version of the configuration list.', example='1.0'),
    }
  ](name='Schemas', description='The detailed configurations of the configuration list.'),
}

model GetInventorySchemaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetInventorySchemaResponseBody(name='body'),
}

/**
 * @summary Queries the properties of a configuration list.
 *
 * @param request GetInventorySchemaRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetInventorySchemaResponse
 */
async function getInventorySchemaWithOptions(request: GetInventorySchemaRequest, runtime: Util.RuntimeOptions): GetInventorySchemaResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aggregator)) {
    query['Aggregator'] = request.aggregator;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.typeName)) {
    query['TypeName'] = request.typeName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetInventorySchema',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the properties of a configuration list.
 *
 * @param request GetInventorySchemaRequest
 * @return GetInventorySchemaResponse
 */
async function getInventorySchema(request: GetInventorySchemaRequest): GetInventorySchemaResponse {
  var runtime = new Util.RuntimeOptions{};
  return getInventorySchemaWithOptions(request, runtime);
}

model GetOpsItemRequest {
  opsItemId?: string(name='OpsItemId', description='The O\\\\&M item ID.

This parameter is required.', example='oi-d52b08695e2b46ae8413'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
}

model GetOpsItemResponseBody = {
  opsItem?: {
    attributes?: map[string]any(name='Attributes', description='The information about the attributes of the O\\\\&M item.'),
    category?: string(name='Category', description='The category of the O\\\\&M item.', example='Security'),
    createBy?: string(name='CreateBy', description='The user who created the O\\\\&M item.', example='root(130900000)'),
    createDate?: string(name='CreateDate', description='The time when the O\\\\&M item was created.', example='2023-04-10T06:15Z'),
    description?: string(name='Description', description='The description.', example='test-update'),
    lastModifiedBy?: string(name='LastModifiedBy', description='The user who last modified the O\\\\&M item.', example='modifiedBy'),
    opsItemId?: string(name='OpsItemId', description='The O\\\\&M item ID.', example='oi-d52b08695e2b46ae8413'),
    priority?: int32(name='Priority', description='The priority of the O\\\\&M item.', example='1'),
    resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-aekzxkofnlxtn2i'),
    resources?: [ string ](name='Resources', description='The Alibaba Cloud Resource Names (ARNs) of the associated resources.'),
    severity?: string(name='Severity', description='The severity level of the O\\\\&M item.', example='Medium'),
    solutions?: [  map[string]any ](name='Solutions', description='The solutions to the O\\\\&M item.'),
    source?: string(name='Source', description='The source business of the O\\\\&M item.', example='/aliyun/appManager'),
    status?: string(name='Status', description='The status of the O\\\\&M item.', example='Open'),
    tags?: map[string]any(name='Tags', description='The tags attached to the O\\\\&M item.', example='{"K1":"V1"}'),
    title?: string(name='Title', description='The title of the O\\\\&M item.', example='test'),
    updateDate?: string(name='UpdateDate', description='The time when the O\\\\&M item was updated.', example='2023-04-10T06:15Z'),
  }(name='OpsItem', description='The information about the O\\\\&M item.'),
  requestId?: string(name='RequestId', description='The request ID.', example='8BED4C16-BD30-5E27-94D4-7EBCCECF70C1'),
}

model GetOpsItemResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetOpsItemResponseBody(name='body'),
}

/**
 * @summary Queries the details of an O\\\\\\\\\\\\&M item.
 *
 * @param request GetOpsItemRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetOpsItemResponse
 */
async function getOpsItemWithOptions(request: GetOpsItemRequest, runtime: Util.RuntimeOptions): GetOpsItemResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.opsItemId)) {
    query['OpsItemId'] = request.opsItemId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetOpsItem',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of an O\\\\\\\\\\\\&M item.
 *
 * @param request GetOpsItemRequest
 * @return GetOpsItemResponse
 */
async function getOpsItem(request: GetOpsItemRequest): GetOpsItemResponse {
  var runtime = new Util.RuntimeOptions{};
  return getOpsItemWithOptions(request, runtime);
}

model GetParameterRequest {
  name?: string(name='Name', description='The name of the common parameter. The name can be up to 200 characters in length and can contain letters, digits, hyphens (-), and underscores (_).

This parameter is required.', example='MyParameter'),
  parameterVersion?: int32(name='ParameterVersion', description='The version number of the common parameter. Valid values: 1 to 100.', example='1'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-acfmxsn4m*****'),
}

model GetParameterResponseBody = {
  parameter?: {
    constraints?: string(name='Constraints', description='The constraints of the common parameter.', example='\\\\"{\\\\"\\\\"AllowedValues":["parameter"],"AllowedPattern":"parameter","MinLength":0,"MaxLength":20}\\\\"'),
    createdBy?: string(name='CreatedBy', description='The user who created the common parameter.', example='root(130900000)'),
    createdDate?: string(name='CreatedDate', description='The time when the common parameter was created.', example='2020-09-01T08:01:43Z'),
    description?: string(name='Description', description='The description of the common parameter.', example='parameter'),
    id?: string(name='Id', description='The ID of the common parameter.', example='p-4c4b401cab6747xxxxxx'),
    name?: string(name='Name', description='The name of the common parameter.', example='MyParameter'),
    parameterVersion?: int32(name='ParameterVersion', description='The version number of the common parameter.', example='1'),
    resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-acfmxsn4m*****'),
    shareType?: string(name='ShareType', description='The share type of the common parameter.', example='Private'),
    tags?: map[string]any(name='Tags', description='The tags added to the common parameter.', example='{"k1":"v1","k2":"v2"}'),
    type?: string(name='Type', description='The data type of the common parameter.', example='String'),
    updatedBy?: string(name='UpdatedBy', description='The user who updated the common parameter.', example='root(130900000)'),
    updatedDate?: string(name='UpdatedDate', description='The time when the common parameter was updated.', example='2020-09-01T08:01:43Z'),
    value?: string(name='Value', description='The value of the common parameter.', example='parameter'),
  }(name='Parameter', description='The information about the common parameter.'),
  requestId?: string(name='RequestId', description='The request ID.', example='BA326372-2A10-4C3B-BE3E-6439DB7557CC'),
}

model GetParameterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetParameterResponseBody(name='body'),
}

/**
 * @summary Queries a common parameter and its value.
 *
 * @param request GetParameterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetParameterResponse
 */
async function getParameterWithOptions(request: GetParameterRequest, runtime: Util.RuntimeOptions): GetParameterResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.parameterVersion)) {
    query['ParameterVersion'] = request.parameterVersion;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetParameter',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a common parameter and its value.
 *
 * @param request GetParameterRequest
 * @return GetParameterResponse
 */
async function getParameter(request: GetParameterRequest): GetParameterResponse {
  var runtime = new Util.RuntimeOptions{};
  return getParameterWithOptions(request, runtime);
}

model GetParametersRequest {
  names?: string(name='Names', description='The names of the common parameters.

This parameter is required.', example='["parameter1","parameter2"]'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
}

model GetParametersResponseBody = {
  invalidParameters?: [ string ](name='InvalidParameters', description='Invalid parameters.'),
  parameters?: [ 
    {
      constraints?: string(name='Constraints', description='The constraints of the common parameter.', example='{\\\\"MaxLength\\\\": 2}'),
      createdBy?: string(name='CreatedBy', description='The user who created the common parameter.', example='root(130900000)'),
      createdDate?: string(name='CreatedDate', description='The time when the common parameter was created.', example='2020-10-22T03:30:45Z'),
      description?: string(name='Description', description='The description of the common parameter.', example='parameter'),
      id?: string(name='Id', description='The ID of the common parameter.', example='p-7cdc0000000000000000'),
      name?: string(name='Name', description='The name of the common parameter.', example='MyParameter'),
      parameterVersion?: int32(name='ParameterVersion', description='The version number of the common parameter.', example='1'),
      resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
      shareType?: string(name='ShareType', description='The share type of the common parameter.', example='Private'),
      tags?: map[string]any(name='Tags', description='The tags.', example='{"k1": "v1", "k2": "v2"}'),
      type?: string(name='Type', description='The type of the parameter.', example='StringList'),
      updatedBy?: string(name='UpdatedBy', description='The user who updated the common parameter.', example='root(130900000)'),
      updatedDate?: string(name='UpdatedDate', description='The time when the parameter was updated.', example='2020-10-22T03:30:45Z'),
      value?: string(name='Value', description='The value of the common parameter.', example='parameter,parameter1'),
    }
  ](name='Parameters', description='The information about the common parameters.'),
  requestId?: string(name='RequestId', description='The request ID.', example='2597E94B-5346-42D1-BB58-D3333EDD0975'),
}

model GetParametersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetParametersResponseBody(name='body'),
}

/**
 * @summary Queries the information about one or more parameters.
 *
 * @param request GetParametersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetParametersResponse
 */
async function getParametersWithOptions(request: GetParametersRequest, runtime: Util.RuntimeOptions): GetParametersResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.names)) {
    query['Names'] = request.names;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetParameters',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about one or more parameters.
 *
 * @param request GetParametersRequest
 * @return GetParametersResponse
 */
async function getParameters(request: GetParametersRequest): GetParametersResponse {
  var runtime = new Util.RuntimeOptions{};
  return getParametersWithOptions(request, runtime);
}

model GetParametersByPathRequest {
  maxResults?: int32(name='MaxResults', description='The number of entries per page.', example='10'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results.', example='MTRBMDc0NjAtRUJFNy00N0NBLTk3NTctMTJDQzA'),
  path?: string(name='Path', description='The path of the parameter. For example, if the name of a parameter is /path/path1/Myparameter, the path of the parameter is /path/path1/.

This parameter is required.', example='/parameter'),
  recursive?: boolean(name='Recursive', description='Specifies whether to recursively query encryption parameters from all levels of directories in the specified path. Valid values: true and false. For example, if you want to query the /secretParameter/mySecretParameter and /secretParameter/secretParameter 1/mySecretParameter parameters, the valid values specify the parameters to be returned.

*   true: returns both of the /secretParameter/mySecretParameter and /secretParameter/secretParameter1/mySecretParameter parameters.
*   false: returns only the /secretParameter/mySecretParameter parameter.', example='false'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
}

model GetParametersByPathResponseBody = {
  maxResults?: int32(name='MaxResults', description='The number of entries per page.', example='10'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results.', example='gAAAAABfTgv5ewUWmNdJ3g7JVLvX70sPH90GZOVGC'),
  parameters?: [ 
    {
      constraints?: string(name='Constraints', description='The constraints of the common parameter.', example='{\\\\"MaxLength\\\\": 2}'),
      createdBy?: string(name='CreatedBy', description='The user who created the common parameter.', example='root(130900000)'),
      createdDate?: string(name='CreatedDate', description='The time when the common parameter was created.', example='2020-10-21T04:03:12Z'),
      description?: string(name='Description', description='The description of the common parameter.', example='parameter'),
      id?: string(name='Id', description='The ID of the common parameter.', example='p-7cdc0000000000000000'),
      name?: string(name='Name', description='The name of the common parameter.', example='myParameter'),
      parameterVersion?: int32(name='ParameterVersion', description='The version number of the common parameter.', example='1'),
      shareType?: string(name='ShareType', description='The share type of the common parameter.', example='Private'),
      tags?: map[string]any(name='Tags', description='The tags added to the common parameters.', example='{"k1": "v1", "k2": "v2"}'),
      type?: string(name='Type', description='The type of the common parameter.', example='StringList'),
      updatedBy?: string(name='UpdatedBy', description='The user who updated the common parameter.', example='root(130900000)'),
      updatedDate?: string(name='UpdatedDate', description='The time when the common parameter was last updated.', example='2020-10-21T04:03:12Z'),
      value?: string(name='Value', description='The value of the common parameter.', example='"parameter1,parameter2"'),
    }
  ](name='Parameters', description='The information about the common parameters.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='25156E99-7437-4590-AA58-2ACA17DE405C'),
  totalCount?: int32(name='TotalCount', description='The total number of returned entries.', example='1'),
}

model GetParametersByPathResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetParametersByPathResponseBody(name='body'),
}

/**
 * @summary Queries one or more parameters by path.
 *
 * @param request GetParametersByPathRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetParametersByPathResponse
 */
async function getParametersByPathWithOptions(request: GetParametersByPathRequest, runtime: Util.RuntimeOptions): GetParametersByPathResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.path)) {
    query['Path'] = request.path;
  }
  if (!Util.isUnset(request.recursive)) {
    query['Recursive'] = request.recursive;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetParametersByPath',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries one or more parameters by path.
 *
 * @param request GetParametersByPathRequest
 * @return GetParametersByPathResponse
 */
async function getParametersByPath(request: GetParametersByPathRequest): GetParametersByPathResponse {
  var runtime = new Util.RuntimeOptions{};
  return getParametersByPathWithOptions(request, runtime);
}

model GetPatchBaselineRequest {
  name?: string(name='Name', description='The name of the patch baseline.

This parameter is required.', example='MyPatchBaseline'),
  regionId?: string(name='RegionId', description='The ID of the region in which the patch baseline whose details you want to query resides.', example='cn-hangzhou'),
}

model GetPatchBaselineResponseBody = {
  patchBaseline?: {
    approvalRules?: string(name='ApprovalRules', description='The rules of scanning and installing patches for the specified operating system.', example='{"PatchRules":[{"PatchFilterGroup":[{"Key":"PatchSet","Values":["OS"]},{"Key":"ProductFamily","Values":["Windows"]},{"Key":"Product","Values":["Windows 10","Windows 7"]},{"Key":"Classification","Values":["Security Updates","Updates","Update Rollups","Critical Updates"]},{"Key":"Severity","Values":["Critical","Important","Moderate"]}],"ApproveAfterDays":7,"ApproveUntilDate":"","EnableNonSecurity":true,"ComplianceLevel":"Medium"}]}'),
    approvedPatches?: [ string ](name='ApprovedPatches', description='The approved patches.'),
    approvedPatchesEnableNonSecurity?: boolean(name='ApprovedPatchesEnableNonSecurity', description='Indicates whether the approved patch involves updates other than security-related updates.', example='true'),
    createdBy?: string(name='CreatedBy', description='The creator of the patch baseline.', example='root(130900000)'),
    createdDate?: string(name='CreatedDate', description='The time when the patch baseline was created.', example='2021-09-07T03:42:56Z'),
    description?: string(name='Description', description='The description of the patch baseline.', example='UpdatePatchBaseline'),
    id?: string(name='Id', description='The ID of the patch baseline.', example='pb-445340b5c6504a85a300'),
    isDefault?: boolean(name='IsDefault', description='Indicates whether the patch baseline is set as the default patch baseline.', example='false'),
    name?: string(name='Name', description='The name of the patch baseline.', example='MypatchBaseline'),
    operationSystem?: string(name='OperationSystem', description='The type of the operating system.', example='Windows'),
    rejectedPatches?: [ string ](name='RejectedPatches', description='The rejected patches.'),
    rejectedPatchesAction?: string(name='RejectedPatchesAction', description='The action of the rejected patch.', example='ALLOW_AS_DEPENDENCY'),
    resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmzmhzoaad5oq'),
    shareType?: string(name='ShareType', description='The share type of the patch baseline.', example='Private'),
    sources?: [ string ](name='Sources', description='The patch source configurations.'),
    tags?: [ 
      {
        tagKey?: string(name='TagKey', description='The key of the tag.', example='key'),
        tagValue?: string(name='TagValue', description='The value of the tag.', example='value'),
      }
    ](name='Tags', description='The tags.'),
    updatedBy?: string(name='UpdatedBy', description='The user who last modified the patch baseline.', example='root(130900000)'),
    updatedDate?: string(name='UpdatedDate', description='The time when the patch baseline was last modified.', example='2021-09-08T07:26:38Z'),
  }(name='PatchBaseline', description='The details of the patch baseline.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='2C630E64-7273-57AC-A598-1B2B8B35CEA5'),
}

model GetPatchBaselineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetPatchBaselineResponseBody(name='body'),
}

/**
 * @summary Queries the information of a patch baseline.
 *
 * @param request GetPatchBaselineRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetPatchBaselineResponse
 */
async function getPatchBaselineWithOptions(request: GetPatchBaselineRequest, runtime: Util.RuntimeOptions): GetPatchBaselineResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetPatchBaseline',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information of a patch baseline.
 *
 * @param request GetPatchBaselineRequest
 * @return GetPatchBaselineResponse
 */
async function getPatchBaseline(request: GetPatchBaselineRequest): GetPatchBaselineResponse {
  var runtime = new Util.RuntimeOptions{};
  return getPatchBaselineWithOptions(request, runtime);
}

model GetSecretParameterRequest {
  name?: string(name='Name', description='The name of the parameter. The name must be 1 to 180 characters in length, and can contain letters, digits, hyphens (-), and underscores (_). It cannot start with ALIYUN, ACS, ALIBABA, ALICLOUD, or OOS.

This parameter is required.', example='MySecretParameter'),
  parameterVersion?: int32(name='ParameterVersion', description='The version number of the common parameter. Valid values: 1 to 100.', example='1'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
  withDecryption?: boolean(name='WithDecryption', description='Specifies whether to decrypt the parameter value. The decrypted parameter value is returned only if this parameter is set to true. Otherwise, null is returned.', example='false'),
}

model GetSecretParameterResponseBody = {
  parameter?: {
    constraints?: string(name='Constraints', description='The constraints of the encryption parameter.', example='\\\\"{\\\\"\\\\"AllowedValues":["secretparameter"],"AllowedPattern":".*","MinLength":0,"MaxLength":20}\\\\"'),
    createdBy?: string(name='CreatedBy', description='The user who created the encryption parameter.', example='root(130900000)'),
    createdDate?: string(name='CreatedDate', description='The time when the encryption parameter was created.', example='2020-09-01T09:28:47Z'),
    DKMSInstanceId?: string(name='DKMSInstanceId', description='The instance ID of the KMS instance.', example='kst-hzz****'),
    description?: string(name='Description', description='The description of the encryption parameter.', example='SecretParameter'),
    id?: string(name='Id', description='The ID of the encryption parameter.', example='p-14ed150fdcd048xxxxxx'),
    keyId?: string(name='KeyId', description='The ID of the key of Key Management Service (KMS) that is used for encryption.', example='80e9409f-78fa-42ab-84bd-83f40c******'),
    name?: string(name='Name', description='The name of the encryption parameter.', example='MySecretParameter'),
    parameterVersion?: int32(name='ParameterVersion', description='The version number of the encryption parameter.', example='1'),
    resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
    shareType?: string(name='ShareType', description='The share type of the encryption parameter.', example='Private'),
    tags?: map[string]any(name='Tags', description='The tags of the parameter.', example='{"k1": "v1", "k2": "v2"}'),
    type?: string(name='Type', description='The type of the parameter.', example='Secret'),
    updatedBy?: string(name='UpdatedBy', description='The user who updated the encryption parameter.', example='root(130900000)'),
    updatedDate?: string(name='UpdatedDate', description='The time when the encryption parameter was updated.', example='2020-09-01T09:35:17Z'),
    value?: string(name='Value', description='The value of the encryption parameter.', example='SecretParameter'),
  }(name='Parameter', description='The information about the encryption parameter.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='7F14FB7C-C9BE-44AE-92ED-21ACC02FBFD2'),
}

model GetSecretParameterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSecretParameterResponseBody(name='body'),
}

/**
 * @summary Queries the information about an encryption parameter, including the parameter value. Make sure that you have the permissions to call the GetSecretValue operation before you call this operation.
 *
 * @param request GetSecretParameterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSecretParameterResponse
 */
async function getSecretParameterWithOptions(request: GetSecretParameterRequest, runtime: Util.RuntimeOptions): GetSecretParameterResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.parameterVersion)) {
    query['ParameterVersion'] = request.parameterVersion;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.withDecryption)) {
    query['WithDecryption'] = request.withDecryption;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetSecretParameter',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about an encryption parameter, including the parameter value. Make sure that you have the permissions to call the GetSecretValue operation before you call this operation.
 *
 * @param request GetSecretParameterRequest
 * @return GetSecretParameterResponse
 */
async function getSecretParameter(request: GetSecretParameterRequest): GetSecretParameterResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSecretParameterWithOptions(request, runtime);
}

model GetSecretParametersRequest {
  names?: string(name='Names', description='The name of the encryption parameter. Multiple encryption parameters can form a JSON array in the format of ["xxxxxxxxx", "yyyyyyyyy", … "zzzzzzzzz"]. Each JSON array can contain a maximum of 10 encryption parameters. Multiple encryption parameters in the array are separated by commas (,).

This parameter is required.', example='["secretParameter","secretParameter1"]'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
  withDecryption?: boolean(name='WithDecryption', description='Specifies whether to decrypt the parameter value. Default value: false. Valid values:

*   true
*   false', example='false'),
}

model GetSecretParametersResponseBody = {
  invalidParameters?: [ string ](name='InvalidParameters', description='Invalid encryption parameter.'),
  parameters?: [ 
    {
      constraints?: string(name='Constraints', description='The constraints of the encryption parameter.', example='{\\\\"AllowedValues\\\\": [\\\\"test\\\\"]}'),
      createdBy?: string(name='CreatedBy', description='The user who created the encryption parameter.', example='root(130900000)'),
      createdDate?: string(name='CreatedDate', description='The time when the encryption parameter was created.', example='2020-10-22T03:11:13Z'),
      description?: string(name='Description', description='The description of the encryption parameter.', example='secretParameter'),
      id?: string(name='Id', description='The ID of the encryption parameter.', example='p-7cdc0000000000000000'),
      keyId?: string(name='KeyId', description='The ID of the key.', example='ssh-bp67acfmxazb4p****'),
      name?: string(name='Name', description='The name of the encryption parameter.', example='MySecretParameter'),
      parameterVersion?: int32(name='ParameterVersion', description='The version number of the encryption parameter.', example='1'),
      resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
      shareType?: string(name='ShareType', description='The share type of the encryption parameter.', example='Private'),
      tags?: map[string]any(name='Tags', description='The tags.', example='{"k1": "v1", "k2": "v2"}'),
      type?: string(name='Type', description='The data type of the encryption parameter.', example='Secret'),
      updatedBy?: string(name='UpdatedBy', description='The user who updated the encryption parameter.', example='root(130900000)'),
      updatedDate?: string(name='UpdatedDate', description='The time when the encryption parameter was updated.', example='2020-10-22T03:11:13Z'),
      value?: string(name='Value', description='The value of the encryption parameter.', example='secretParameter,secretParameter1'),
    }
  ](name='Parameters', description='The information about the encryption parameter.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='A5320F1D-92D9-44BB-A416-5FC525ED6D57'),
}

model GetSecretParametersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSecretParametersResponseBody(name='body'),
}

/**
 * @summary Queries the information about one or more encryption parameters. Make sure that you have the permissions to call the GetSecretValue operation before you call this operation.
 *
 * @param request GetSecretParametersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSecretParametersResponse
 */
async function getSecretParametersWithOptions(request: GetSecretParametersRequest, runtime: Util.RuntimeOptions): GetSecretParametersResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.names)) {
    query['Names'] = request.names;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.withDecryption)) {
    query['WithDecryption'] = request.withDecryption;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetSecretParameters',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about one or more encryption parameters. Make sure that you have the permissions to call the GetSecretValue operation before you call this operation.
 *
 * @param request GetSecretParametersRequest
 * @return GetSecretParametersResponse
 */
async function getSecretParameters(request: GetSecretParametersRequest): GetSecretParametersResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSecretParametersWithOptions(request, runtime);
}

model GetSecretParametersByPathRequest {
  maxResults?: int32(name='MaxResults', description='The number of entries per page. Valid values: 1 to 10. Default value: 10.', example='10'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results.', example='MTRBMDc0NjAtRUJFNy00N0NBLTk3NTctMTJDQzA'),
  path?: string(name='Path', description='The path of the encryption parameter. The path must be 1 to 200 characters in length. For example, if the name of an encryption parameter is /secretParameter/mySecretParameter, the path of the encryption parameter is /secretParameter.

This parameter is required.', example='/secretParameter'),
  recursive?: boolean(name='Recursive', description='Specifies whether to recursively query encryption parameters from all levels of directories in the specified path. Valid values: true and false. For example, if you want to query the /secretParameter/mySecretParameter and /secretParameter/secretParameter 1/mySecretParameter parameters, the valid values specify the parameters to be returned.

*   true: returns both of the /secretParameter/mySecretParameter and /secretParameter/secretParameter1/mySecretParameter parameters.
*   false: returns only the /secretParameter/mySecretParameter parameter.', example='false'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  withDecryption?: boolean(name='WithDecryption', description='Specifies whether to decrypt the parameter value. Default value: false. Valid values:

*   true
*   false', example='true'),
}

model GetSecretParametersByPathResponseBody = {
  maxResults?: int32(name='MaxResults', description='The number of entries per page.', example='10'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results.', example='gAAAAABfTgv5ewUWmNdJ3g7JVLvX70sPH90GZOVGC'),
  parameters?: [ 
    {
      constraints?: string(name='Constraints', description='The constraints of the encryption parameter.', example='{\\\\"AllowedPattern\\\\": \\\\"^[a-g]*$\\\\"}'),
      createdBy?: string(name='CreatedBy', description='The user who created the encryption parameter.', example='root(130900000)'),
      createdDate?: string(name='CreatedDate', description='The time when the encryption parameter was updated.', example='2020-10-21T06:22:48Z'),
      description?: string(name='Description', description='The description of the encryption parameter.', example='secretParameter'),
      id?: string(name='Id', description='The ID of the encryption parameter.', example='p-7cdc0000000000000000'),
      keyId?: string(name='KeyId', description='The ID of the key.', example='090xxbex-xexx-xxxx-axfc-ddxxcxxxxcex'),
      name?: string(name='Name', description='The name of the encryption parameter.', example='mySecretParameter'),
      parameterVersion?: int32(name='ParameterVersion', description='The version number of the encryption parameter.', example='1'),
      shareType?: string(name='ShareType', description='The share type of the encryption parameter.', example='Private'),
      type?: string(name='Type', description='The data type of the encryption parameter.', example='Secret'),
      updatedBy?: string(name='UpdatedBy', description='The user who updated the encryption parameter.', example='root(130900000)'),
      updatedDate?: string(name='UpdatedDate', description='The time when the encryption parameter was updated.', example='2020-10-21T06:22:48Z'),
      value?: string(name='Value', description='The value of the encryption parameter.', example='secretParameter'),
    }
  ](name='Parameters', description='The information about the encryption parameters.'),
  requestId?: string(name='RequestId', description='The request ID.', example='25156E99-7437-4590-AA58-2ACA17DE405C'),
  totalCount?: int32(name='TotalCount', description='The total number of returned entries.', example='10'),
}

model GetSecretParametersByPathResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSecretParametersByPathResponseBody(name='body'),
}

/**
 * @summary Queries encryption parameters by path. Make sure that you have the permissions to call the GetSecretValue operation before you call this operation.
 *
 * @param request GetSecretParametersByPathRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSecretParametersByPathResponse
 */
async function getSecretParametersByPathWithOptions(request: GetSecretParametersByPathRequest, runtime: Util.RuntimeOptions): GetSecretParametersByPathResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.path)) {
    query['Path'] = request.path;
  }
  if (!Util.isUnset(request.recursive)) {
    query['Recursive'] = request.recursive;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.withDecryption)) {
    query['WithDecryption'] = request.withDecryption;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetSecretParametersByPath',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries encryption parameters by path. Make sure that you have the permissions to call the GetSecretValue operation before you call this operation.
 *
 * @param request GetSecretParametersByPathRequest
 * @return GetSecretParametersByPathResponse
 */
async function getSecretParametersByPath(request: GetSecretParametersByPathRequest): GetSecretParametersByPathResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSecretParametersByPathWithOptions(request, runtime);
}

model GetServiceSettingsRequest {
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
}

model GetServiceSettingsResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='9F755DC9-C0CF-4598-B2E3-2CC763F18CB2'),
  serviceSettings?: [ 
    {
      deliveryOssBucketName?: string(name='DeliveryOssBucketName', description='The name of OSS bucket to deliver.', example='OssBucketName'),
      deliveryOssEnabled?: boolean(name='DeliveryOssEnabled', description='Whether to enable OSS delivery.', example='false'),
      deliveryOssKeyPrefix?: string(name='DeliveryOssKeyPrefix', description='The key prefix of OSS to deliver.', example='oos/execution'),
      deliverySlsEnabled?: boolean(name='DeliverySlsEnabled', description='Whether to enable SLS delivery.', example='false'),
      deliverySlsProjectName?: string(name='DeliverySlsProjectName', description='The name of SLS project to deliver.', example='SlsProjectName'),
      rdcEnterpriseId?: string(name='RdcEnterpriseId', description='The id of RDC Enterprise.', example='RdcEnterpriseId'),
    }
  ](name='ServiceSettings', description='The information of service settings.'),
}

model GetServiceSettingsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetServiceSettingsResponseBody(name='body'),
}

/**
 * @summary Queries the settings of the delivery feature.
 *
 * @param request GetServiceSettingsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetServiceSettingsResponse
 */
async function getServiceSettingsWithOptions(request: GetServiceSettingsRequest, runtime: Util.RuntimeOptions): GetServiceSettingsResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetServiceSettings',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the settings of the delivery feature.
 *
 * @param request GetServiceSettingsRequest
 * @return GetServiceSettingsResponse
 */
async function getServiceSettings(request: GetServiceSettingsRequest): GetServiceSettingsResponse {
  var runtime = new Util.RuntimeOptions{};
  return getServiceSettingsWithOptions(request, runtime);
}

model GetTemplateRequest {
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  templateName?: string(name='TemplateName', description='The name of the template. The name can be 1 to 200 characters in length and can contain letters, digits, hyphens (-), and underscores (_). The name cannot start with ALIYUN, ACS, ALIBABA, or ALICLOUD.

This parameter is required.', example='MyTemplate'),
  templateVersion?: string(name='TemplateVersion', description='The version of the template. The default value is the latest version of the template.', example='v1'),
}

model GetTemplateResponseBody = {
  content?: string(name='Content', description='The content of the template.', example='"FormatVersion: OOS-2019-06-01\\\\nDescription:\\\\n  en:  Creates an ECS image\\\\n  zh-cn: 创建一个ECS镜像\\\\n  name-en: Create Image\\\\n  name-zh-cn: 创建镜像\\\\n  categories:\\\\n    - image_manage\\\\n    - application_manage\\\\nParameters:\\\\n  regionId:\\\\n    Type: String\\\\n    Label:\\\\n      en: RegionId\\\\n      zh-cn: 地域ID\\\\n    AssociationProperty: RegionId\\\\n    Default: \\\\"{{ ACS::RegionId }}\\\\"\\\\n  instanceId:\\\\n    Label:\\\\n      en: InstanceId\\\\n      zh-cn: ECS实例ID\\\\n    Type: String\\\\n    AssociationProperty: ALIYUN::ECS::Instance::InstanceId\\\\n    AssociationPropertyMetadata:\\\\n      RegionId: regionId\\\\n  imageName:\\\\n    Label:\\\\n      en: ImageName\\\\n      zh-cn: 新镜像的名称\\\\n    Type: String\\\\n    Description:\\\\n      en: <p class=\\\\"p\\\\">Note:</p> <ul class=\\\\"ul\\\\"> <li class=\\\\"li\\\\">Length is 2~128 English or Chinese characters</li> <li class=\\\\"li\\\\"><font color=\\\\"red\\\\">must start with big or small letters or Chinese, not http:// and https://. </font></li> <li class=\\\\"li\\\\">Can contain numbers, colons (:), underscores (_), or dashes (-). </li> </ul>\\\\n      zh-cn: <p class=\\\\"p\\\\">注意：</p> <ul class=\\\\"ul\\\\"> <li class=\\\\"li\\\\">长度为2~128个英文或中文字符</li> <li class=\\\\"li\\\\"><font color=\\\\"red\\\\">必须以大小字母或中文开头，不能以http://和https://开头。</font></li> <li class=\\\\"li\\\\">可以包含数字、半角冒号（:）、下划线（_）或者短划线（-）。</li> </ul>\\\\n  tags:\\\\n    Label:\\\\n      en: Tags\\\\n      zh-cn: 镜像标签\\\\n    Type: Json\\\\n    AssociationProperty: Tags\\\\n    AssociationPropertyMetadata:\\\\n      ShowSystem: false\\\\n    Default: []\\\\n  OOSAssumeRole:\\\\n    Label:\\\\n      en: OOSAssumeRole\\\\n      zh-cn: OOS扮演的RAM角色\\\\n    Type: String\\\\n    Default: OOSServiceRole\\\\nRamRole: \\\\"{{ OOSAssumeRole }}\\\\"\\\\nTasks:\\\\n- Name: createImage\\\\n  Action: ACS::ECS::CreateImage\\\\n  Description:\\\\n    en: Create new image with the specified image name and instance ID\\\\n    zh-cn: 通过指定实例ID和镜像名称创建新的镜像\\\\n  Properties:\\\\n    regionId: \\\\"{{ regionId }}\\\\"\\\\n    imageName: \\\\"{{ imageName }}__on_{{ ACS::ExecutionId }}_at_{{ Acs::CurrentDate }}\\\\"\\\\n    instanceId: \\\\"{{ instanceId }}\\\\"\\\\n    tags: \\\\"{{tags}}\\\\"\\\\n  Outputs:\\\\n    imageId:\\\\n      ValueSelector: imageId\\\\n      Type: String\\\\nOutputs:\\\\n  imageId:\\\\n    Type: String\\\\n    Value: \\\\"{{ createImage.imageId }}\\\\"\\\\nMetadata:\\\\n  ALIYUN::OOS::Interface:\\\\n    ParameterGroups:\\\\n      - Parameters:\\\\n          - regionId\\\\n          - instanceId\\\\n        Label:\\\\n          default:\\\\n            zh-cn: 选择实例\\\\n            en: Select Ecs Instances\\\\n      - Parameters:\\\\n          - imageName\\\\n          - tags\\\\n        Label:\\\\n          default:\\\\n            zh-cn: 镜像设置\\\\n            en: Image Configure\\\\n      - Parameters:\\\\n          - OOSAssumeRole\\\\n        Label:\\\\n          default:\\\\n            zh-cn: 高级选项\\\\n            en: Control Options"'),
  requestId?: string(name='RequestId', description='The request ID.', example='5BBE2663-A18E-5261-9BBB-F4832F5294D9'),
  template?: {
    createdBy?: string(name='CreatedBy', description='The creator of the template.', example='ACS'),
    createdDate?: string(name='CreatedDate', description='The time when the template was created.', example='2019-05-16T10:26:14Z'),
    description?: string(name='Description', description='The description of the template.', example='"{\\\\"en\\\\": \\\\"Creates an ECS image\\\\", \\\\"zh-cn\\\\": \\\\"创建一个ECS镜像\\\\", \\\\"name-en\\\\": \\\\"Create Image\\\\", \\\\"name-zh-cn\\\\": \\\\"创建镜像\\\\", \\\\"categories\\\\": [\\\\"image_manage\\\\", \\\\"application_manage\\\\"]}"'),
    hasTrigger?: boolean(name='HasTrigger', description='Indicates whether the template was configured with a trigger.', example='false'),
    hash?: string(name='Hash', description='The SHA-256 value of the template content.', example='40fb5e3e08ef6c8a499ff7cd8441194f518028ad08338a84cb70c023a64576f1'),
    resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
    shareType?: string(name='ShareType', description='The share type of the template. The share type of a user-created template is **Private**.', example='Public'),
    tags?: map[string]any(name='Tags', description='The tag keys and values. The number of key-value pairs ranges from 1 to 20.', example='{"k1":"k2","k2":"v2"}'),
    templateFormat?: string(name='TemplateFormat', description='The format of the template. The system automatically determines whether the format is JSON or YAML.', example='YAML'),
    templateId?: string(name='TemplateId', description='The ID of the template.', example='t-4bdb1745c171401883a2'),
    templateName?: string(name='TemplateName', description='The name of the template.', example='ACS-ECS-CreateImage'),
    templateType?: string(name='TemplateType', description='The type of the template.', example='Automation'),
    templateVersion?: string(name='TemplateVersion', description='The version of the template. The name of the version consists of the letter v and a number. The number starts from 1.', example='v15'),
    updatedBy?: string(name='UpdatedBy', description='The user who last updated the template.', example='ACS'),
    updatedDate?: string(name='UpdatedDate', description='The time when the template was last updated.', example='2022-04-26T08:37:07Z'),
    versionName?: string(name='VersionName', description='The name of the version of the template.', example='version15'),
  }(name='Template', description='The metadata of the template.'),
}

model GetTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTemplateResponseBody(name='body'),
}

/**
 * @summary Queries the information about a template, including the content of the template.
 *
 * @param request GetTemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTemplateResponse
 */
async function getTemplateWithOptions(request: GetTemplateRequest, runtime: Util.RuntimeOptions): GetTemplateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.templateName)) {
    query['TemplateName'] = request.templateName;
  }
  if (!Util.isUnset(request.templateVersion)) {
    query['TemplateVersion'] = request.templateVersion;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetTemplate',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about a template, including the content of the template.
 *
 * @param request GetTemplateRequest
 * @return GetTemplateResponse
 */
async function getTemplate(request: GetTemplateRequest): GetTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  return getTemplateWithOptions(request, runtime);
}

model GetTemplateParameterConstraintsRequest {
  parameters?: string(name='Parameters', description='The information about the parameters.', example='{\\\\"endDate\\\\": \\\\"2022-04-13T03:31:20Z\\\\", \\\\"Status\\\\": \\\\"Stopped\\\\"}'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  templateContent?: string(name='TemplateContent', description='The content of the template in the JSON or YAML format. This parameter is the same as the Content parameter that you can specify when you call the CreateTemplate operation. You can use this parameter to specify the tasks that you want to run. This way, you do not need to create a template before you start an execution. If you select an existing template, you do not need to specify this parameter.', example='{
	"Description": "Example template, describe instances in some status",
	"FormatVersion": "OOS-2019-06-01",
	"Parameters": {},
	"Tasks": [{
		"Name": "describeInstances",
		"Action": "ACS::ExecuteAPI",
		"Description": "desc-en",
		"Properties": {
			"Service": "ECS",
			"API": "DescribeInstances",
			"Parameters": {
				"Status": "Running"
			}
		}
	}]
}'),
  templateName?: string(name='TemplateName', description='The name of the template.', example='MyTemplate'),
  templateURL?: string(name='TemplateURL', description='The URL that is used to store the content of the Operation Orchestration Service (OOS) template in the Alibaba Cloud Object Storage Service (OSS). Only the public-read URL is supported. You can use this parameter to specify the tasks that you want to run. This way, you do not need to create a template before you start an execution. If you select an existing template, you do not need to specify this parameter.', example='http://oos-template.cn-hangzhou.oss.aliyun-inc.com/oos-test-template.json'),
  templateVersion?: string(name='TemplateVersion', description='The version of the template. The default value is the latest version of the template.', example='v1'),
}

model GetTemplateParameterConstraintsResponseBody = {
  parameterConstraints?: map[string]any(name='ParameterConstraints', description='The constraints of the parameters.', example='[
    {
      "Type": "String",
      "AllowedValues": [
        "ecs.n1.tiny",
        "ecs.r8a.4xlarge",
        "ecs.n2.xlarge",
        "ecs.c7.2xlarge",
        "ecs.c8i.4xlarge",
        "ecs.g8i.48xlarge",
        "ecs.c8a.4xlarge",
        "ecs.i2.4xlarge",
        "ecs.r8y.2xlarge"
      ],
      "AssociationParameterNames": [
        "RegionId",
        "zoneId"
      ],
      "ParameterKey": "instanceType"
    },
    {
      "Type": "String",
      "AllowedValues": [],
      "AssociationParameterNames": [
        "RegionId",
        "zoneId",
        "InstanceType"
      ],
      "ParameterKey": "systemDiskCategory"
    }
  ]'),
  requestId?: string(name='RequestId', description='The request ID.', example='CBEC8072-BEC2-478E-8EAE-E723BA79CF19'),
}

model GetTemplateParameterConstraintsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTemplateParameterConstraintsResponseBody(name='body'),
}

/**
 * @summary 获取参数可用值
 *
 * @param request GetTemplateParameterConstraintsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTemplateParameterConstraintsResponse
 */
async function getTemplateParameterConstraintsWithOptions(request: GetTemplateParameterConstraintsRequest, runtime: Util.RuntimeOptions): GetTemplateParameterConstraintsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.parameters)) {
    query['Parameters'] = request.parameters;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.templateContent)) {
    query['TemplateContent'] = request.templateContent;
  }
  if (!Util.isUnset(request.templateName)) {
    query['TemplateName'] = request.templateName;
  }
  if (!Util.isUnset(request.templateURL)) {
    query['TemplateURL'] = request.templateURL;
  }
  if (!Util.isUnset(request.templateVersion)) {
    query['TemplateVersion'] = request.templateVersion;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetTemplateParameterConstraints',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取参数可用值
 *
 * @param request GetTemplateParameterConstraintsRequest
 * @return GetTemplateParameterConstraintsResponse
 */
async function getTemplateParameterConstraints(request: GetTemplateParameterConstraintsRequest): GetTemplateParameterConstraintsResponse {
  var runtime = new Util.RuntimeOptions{};
  return getTemplateParameterConstraintsWithOptions(request, runtime);
}

model ListActionsRequest {
  maxResults?: int32(name='MaxResults', description='The number of entries to return on each page. Valid values: 20 to 100. Default value: 50.', example='50'),
  nextToken?: string(name='NextToken', description='The token that is used to retrieve the next page of results.', example='-'),
  OOSActionName?: string(name='OOSActionName', description='The name of the action. All actions whose names contain the specified action name are returned.', example='MyTemplate'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
}

model ListActionsResponseBody = {
  actions?: [ 
    {
      actionType?: string(name='ActionType', description='The type of the action.

1.  Atomic actions

    *   Atomic.API
    *   Atomic.Trigger
    *   Atomic.Control
    *   Atomic.Embedded

2.  Cloud product actions

    *   Product.ECS
    *   Product.RDS
    *   Product.VPC
    *   Product.FC
    *   ...', example='ACS::Template'),
      createdDate?: string(name='CreatedDate', description='The time when the action was created.', example='2019-05-16T10:26:14Z'),
      description?: string(name='Description', description='The description of the action.', example='ReplaceSystemDisk'),
      OOSActionName?: string(name='OOSActionName', description='The name of the action.', example='ACS::ECS::ReplaceSystemDisk'),
      popularity?: int32(name='Popularity', description='The number of times that the action is used.', example='5'),
      properties?: string(name='Properties', description='The parameters of the action.', example='{ "ImageId": { "Description": "The mirror ID you will use when resetting the system", "Type": "String" }, "InstanceId": { "Description": "the instance id that you will handle .", "Type": "String" } }'),
      templateVersion?: string(name='TemplateVersion', description='The version of the template that corresponds to the action.

>  For atomic actions, this parameter is not returned.', example='v1'),
    }
  ](name='Actions', description='The details of the actions.'),
  maxResults?: int32(name='MaxResults', description='The number of entries returned per page.', example='50'),
  nextToken?: string(name='NextToken', description='The token that is used to retrieve the next page of results.', example='xxx'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='F9154C02-F847-4563-BB6A-6DD01A4F0'),
}

model ListActionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListActionsResponseBody(name='body'),
}

/**
 * @summary Queries the available actions, including atomic actions and cloud product actions.
 *
 * @param request ListActionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListActionsResponse
 */
async function listActionsWithOptions(request: ListActionsRequest, runtime: Util.RuntimeOptions): ListActionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.OOSActionName)) {
    query['OOSActionName'] = request.OOSActionName;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListActions',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the available actions, including atomic actions and cloud product actions.
 *
 * @param request ListActionsRequest
 * @return ListActionsResponse
 */
async function listActions(request: ListActionsRequest): ListActionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listActionsWithOptions(request, runtime);
}

model ListApplicationGroupsRequest {
  applicationName?: string(name='ApplicationName', description='The name of the application.', example='MyApplication'),
  deployRegionId?: string(name='DeployRegionId', description='The ID of the region in which the related resources reside.', example='cn-hangzhou'),
  maxResults?: int32(name='MaxResults', description='The number of entries to return on each page.', example='10'),
  nextToken?: string(name='NextToken', description='The token that is used to retrieve the next page of results.', example='-'),
  regionId?: string(name='RegionId', description='The ID of the region. Set the value to cn-hangzhou.', example='cn-hangzhou'),
  resourceId?: string(name='ResourceId', description='The ID of the cloud resource.', example='i-2vcj9raxrhxb48zz3whw'),
  resourceProduct?: string(name='ResourceProduct', description='The code of the product to which the cloud resource belongs.', example='ecs'),
  resourceType?: string(name='ResourceType', description='The type of the cloud resource.', example='instance'),
}

model ListApplicationGroupsResponseBody = {
  applicationGroups?: [ 
    {
      applicationName?: string(name='ApplicationName', description='The name of the application.', example='MyApplication'),
      cmsGroupId?: string(name='CmsGroupId', description='The ID of the application group in CloudMonitor.', example='12345678'),
      createDate?: string(name='CreateDate', description='The time when the application group was created.', example='2021-09-07T10:28:25Z'),
      deployParameters?: string(name='DeployParameters', description='The configuration information of the application group.', example='{   "TemplateURL": "https://ros-template.oss-cn-zhangjiakou.aliyuncs.com/App_Management_Existing_Vpc_Ecs_Instance.json",   "Parameters": {     "ZoneId": "cn-hangzhou-k",     "ProjectName": "test",     "SystemDiskSize": 40,     "InstanceChargeType": "PostPaid",     "SecurityGroupId": "sg-bp1a4374akk63jl8tddy",     "VSwitchId": "vsw-bp1fcvc3zn0jrag86rrlm",     "SystemDiskCategory": "cloud_essd",     "InstancePassword": "******",     "InternetChargeType": "PayByTraffic",     "InstanceCount": 1,     "InternetMaxBandwidthOut": 0,     "VpcId": "vpc-bp1i99boyas8i8m9t3skp",     "EcsImageId": "centos_8_5_x64_20G_alibase_20211228.vhd",     "DataDiskSize": 100,     "EcsInstanceType": "ecs.s6-c1m4.small",     "DataDiskCategory": "cloud_efficiency",     "EnvironmentCommandId": "c-hz028fc3g031gcg"   },   "RegionId": "cn-hangzhou",   "StackName": "stack-1645688523068-3no_AKhOJ",   "DisableRollback": true }'),
      deployRegionId?: string(name='DeployRegionId', description='The ID of the region in which the related resources reside.', example='cn-hangzhou'),
      description?: string(name='Description', description='The description of the application group.', example='ApplicationGroup'),
      importTagKey?: string(name='ImportTagKey', description='The tag key.', example='k1'),
      importTagValue?: string(name='ImportTagValue', description='The tag value.', example='v1'),
      name?: string(name='Name', description='The name of the application group.', example='UpdateMyApplicationGroup'),
      status?: string(name='Status', description='The state of the application group.', example='Created'),
      statusReason?: string(name='StatusReason', description='The state information of the application group.', example='ApplicationGroup is Created.'),
      updateDate?: string(name='UpdateDate', description='The time when the application group was updated.', example='2021-09-08T03:01:53Z'),
    }
  ](name='ApplicationGroups', description='The details of the application group.'),
  maxResults?: int32(name='MaxResults', description='The number of entries returned on each page.', example='10'),
  nextToken?: string(name='NextToken', description='The token that is used to retrieve the next page of results.', example='-'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='69D97BF2-5DF2-544C-A650-36A474E17BC3'),
}

model ListApplicationGroupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListApplicationGroupsResponseBody(name='body'),
}

/**
 * @summary Queries a list of application groups. You can call this operation only for the application groups that reside in the China (Hangzhou) region. Use an endpoint of the China (Hangzhou) region.
 *
 * @param request ListApplicationGroupsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListApplicationGroupsResponse
 */
async function listApplicationGroupsWithOptions(request: ListApplicationGroupsRequest, runtime: Util.RuntimeOptions): ListApplicationGroupsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.applicationName)) {
    query['ApplicationName'] = request.applicationName;
  }
  if (!Util.isUnset(request.deployRegionId)) {
    query['DeployRegionId'] = request.deployRegionId;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceProduct)) {
    query['ResourceProduct'] = request.resourceProduct;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListApplicationGroups',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of application groups. You can call this operation only for the application groups that reside in the China (Hangzhou) region. Use an endpoint of the China (Hangzhou) region.
 *
 * @param request ListApplicationGroupsRequest
 * @return ListApplicationGroupsResponse
 */
async function listApplicationGroups(request: ListApplicationGroupsRequest): ListApplicationGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listApplicationGroupsWithOptions(request, runtime);
}

model ListApplicationsRequest {
  applicationType?: string(name='ApplicationType', description='The type of the application.

Valid values:

*   ComputeNest

    <!-- -->

    <!-- -->

    <!-- -->

*   Custom

    <!-- -->

    <!-- -->

    <!-- -->

*   DingTalk

    <!-- -->

    <!-- -->

    <!-- -->', example='DingTalk'),
  maxResults?: int32(name='MaxResults', description='The number of entries to return on each page. Valid values: 10 to 100. Default value: 50.', example='10'),
  name?: string(name='Name', description='The name of the application.', example='"MyApplications"'),
  names?: string(name='Names', description='The names of the applications.', example='["MyApplication"]'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results.', example='-'),
  regionId?: string(name='RegionId', description='The region ID. Set the value to cn-hangzhou.', example='cn-hangzhou'),
  tags?: map[string]any(name='Tags', description='The tags.', example='{"k1": "v1","k2": "v2"}'),
}

model ListApplicationsShrinkRequest {
  applicationType?: string(name='ApplicationType', description='The type of the application.

Valid values:

*   ComputeNest

    <!-- -->

    <!-- -->

    <!-- -->

*   Custom

    <!-- -->

    <!-- -->

    <!-- -->

*   DingTalk

    <!-- -->

    <!-- -->

    <!-- -->', example='DingTalk'),
  maxResults?: int32(name='MaxResults', description='The number of entries to return on each page. Valid values: 10 to 100. Default value: 50.', example='10'),
  name?: string(name='Name', description='The name of the application.', example='"MyApplications"'),
  names?: string(name='Names', description='The names of the applications.', example='["MyApplication"]'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results.', example='-'),
  regionId?: string(name='RegionId', description='The region ID. Set the value to cn-hangzhou.', example='cn-hangzhou'),
  tagsShrink?: string(name='Tags', description='The tags.', example='{"k1": "v1","k2": "v2"}'),
}

model ListApplicationsResponseBody = {
  applications?: [ 
    {
      applicationType?: string(name='ApplicationType', description='The type of the application.', example='DingTalk'),
      createDate?: string(name='CreateDate', description='The time when the application was created.', example='2021-09-07T09:09:59Z'),
      description?: string(name='Description', description='The description of the application.', example='Application'),
      name?: string(name='Name', description='The name of the application.', example='MyApplication'),
      resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-acfmxsn4m******'),
      tags?: map[string]any(name='Tags', description='The tags added to the application.', example='{"k1": "v1","k2": "v2"}'),
      updateDate?: string(name='UpdateDate', description='The time when the application was updated.', example='2021-09-07T09:09:59Z'),
    }
  ](name='Applications', description='The details of the application.'),
  maxResults?: int32(name='MaxResults', description='The number of entries returned per page.', example='10'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results.', example='-'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='12067D53-56A9-561B-ADD6-61429D207117'),
}

model ListApplicationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListApplicationsResponseBody(name='body'),
}

/**
 * @summary Queries a list of applications. You can call this operation only for the applications that reside in the China (Hangzhou) region. Use an endpoint of the China (Hangzhou) region.
 *
 * @param tmpReq ListApplicationsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListApplicationsResponse
 */
async function listApplicationsWithOptions(tmpReq: ListApplicationsRequest, runtime: Util.RuntimeOptions): ListApplicationsResponse {
  Util.validateModel(tmpReq);
  var request = new ListApplicationsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.tags)) {
    request.tagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tags, 'Tags', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.applicationType)) {
    query['ApplicationType'] = request.applicationType;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.names)) {
    query['Names'] = request.names;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.tagsShrink)) {
    query['Tags'] = request.tagsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListApplications',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of applications. You can call this operation only for the applications that reside in the China (Hangzhou) region. Use an endpoint of the China (Hangzhou) region.
 *
 * @param request ListApplicationsRequest
 * @return ListApplicationsResponse
 */
async function listApplications(request: ListApplicationsRequest): ListApplicationsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listApplicationsWithOptions(request, runtime);
}

model ListExecutionLogsRequest {
  executionId?: string(name='ExecutionId', description='The ID of the execution.

This parameter is required.', example='exec-xxx'),
  logType?: string(name='LogType', description='The type of the log.', example='System'),
  maxResults?: int32(name='MaxResults', description='The number of entries to return on each page.', example='50'),
  nextToken?: string(name='NextToken', description='The token that is used to retrieve the next page of results.', example='MTRBMDc0NjAtRUJFNy00N0NBLTk3NTctMTJDQzQ3NjFENDdB'),
  regionId?: string(name='RegionId', description='The ID of the region in which you want to query the logs of the execution.', example='cn-hangzhou'),
  taskExecutionId?: string(name='TaskExecutionId', description='The execution ID of the task.', example='exec-1234567zxcvb.t0010'),
}

model ListExecutionLogsResponseBody = {
  executionLogs?: [ 
    {
      logType?: string(name='LogType', description='The log type.', example='System'),
      message?: string(name='Message', description='The details of the task execution.', example='The task CheckDiskCategory completed.'),
      taskExecutionId?: string(name='TaskExecutionId', description='The task execution ID.', example='exec-1234567zxcvb.t0010'),
      timestamp?: string(name='Timestamp', description='The timestamp when the task was run.', example='2019-05-24T:02:29:07Z'),
    }
  ](name='ExecutionLogs', description='The logs of the execution.'),
  isTruncated?: boolean(name='IsTruncated', description='Indicates whether the log is truncated.', example='true'),
  maxResults?: int32(name='MaxResults', description='The number of entries per page.', example='50'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results.', example='gAAAAABdpsGWjX8dJ-a6dl_pvoS7AFxNHSNJKHLCAJJ0ylgA53nWW5V4HTEZKCYTaEPNOrxFir4z43UTOjE150cFr8AGTifA=='),
  requestId?: string(name='RequestId', description='The request ID.', example='14A07460-EBE7-47CA-9757-12CC4761D47A'),
}

model ListExecutionLogsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListExecutionLogsResponseBody(name='body'),
}

/**
 * @summary Queries the logs of an execution.
 *
 * @description ****
 *
 * @param request ListExecutionLogsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListExecutionLogsResponse
 */
async function listExecutionLogsWithOptions(request: ListExecutionLogsRequest, runtime: Util.RuntimeOptions): ListExecutionLogsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.executionId)) {
    query['ExecutionId'] = request.executionId;
  }
  if (!Util.isUnset(request.logType)) {
    query['LogType'] = request.logType;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.taskExecutionId)) {
    query['TaskExecutionId'] = request.taskExecutionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListExecutionLogs',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the logs of an execution.
 *
 * @description ****
 *
 * @param request ListExecutionLogsRequest
 * @return ListExecutionLogsResponse
 */
async function listExecutionLogs(request: ListExecutionLogsRequest): ListExecutionLogsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listExecutionLogsWithOptions(request, runtime);
}

model ListExecutionRiskyTasksRequest {
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
  templateName?: string(name='TemplateName', description='The name of the template.

This parameter is required.', example='myTemplate'),
}

model ListExecutionRiskyTasksResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='C04B668D-D2DD-4B40-B6E9-0E3C4F53D5B5'),
  riskyTasks?: [ 
    {
      API?: string(name='API', description='The name of the operation that the high-risk task calls.', example='DeleteInstance'),
      service?: string(name='Service', description='The cloud service in which the high-risk task runs.', example='ECS'),
      task?: [ string ](name='Task', description='The details of the high-risk task.'),
      template?: [ string ](name='Template', description='The details of templates to which the high-risk task belongs.'),
    }
  ](name='RiskyTasks', description='The information about high-risk tasks.'),
}

model ListExecutionRiskyTasksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListExecutionRiskyTasksResponseBody(name='body'),
}

/**
 * @summary Queries high-risk tasks in the execution of a template.
 *
 * @param request ListExecutionRiskyTasksRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListExecutionRiskyTasksResponse
 */
async function listExecutionRiskyTasksWithOptions(request: ListExecutionRiskyTasksRequest, runtime: Util.RuntimeOptions): ListExecutionRiskyTasksResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.templateName)) {
    query['TemplateName'] = request.templateName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListExecutionRiskyTasks',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries high-risk tasks in the execution of a template.
 *
 * @param request ListExecutionRiskyTasksRequest
 * @return ListExecutionRiskyTasksResponse
 */
async function listExecutionRiskyTasks(request: ListExecutionRiskyTasksRequest): ListExecutionRiskyTasksResponse {
  var runtime = new Util.RuntimeOptions{};
  return listExecutionRiskyTasksWithOptions(request, runtime);
}

model ListExecutionsRequest {
  categories?: string(name='Categories', description='The types of the execution template. Valid values: Other, TimerTrigger, EventTrigger, and AlarmTrigger. You can specify only one of the Categories and Category parameters. We recommend that you specify Categories.', example='["TimerTrigger"、"EventTrigger"]'),
  category?: string(name='Category', description='The type of the execution template. Valid values: Other, TimerTrigger, EventTrigger, and AlarmTrigger.', example='Other'),
  depth?: string(name='Depth', description='The depth of execution. Valid values: RootDepth and FirstChildDepth. If you set this parameter to RootDepth, only the parent execution is returned. If you set this parameter to FirstChildDepth, only the child executions at the first level are returned. You can specify only one of the Depth and IncludeChildExecution parameters. We recommend that you specify Depth.', example='RootDepth'),
  description?: string(name='Description', description='The description of the execution.', example='MyDescription'),
  endDateAfter?: string(name='EndDateAfter', description='The earliest end time. The executions that stop running at or later than the specified time are queried.', example='2019-05-16T10:26:14Z'),
  endDateBefore?: string(name='EndDateBefore', description='The latest end time. The executions that stop running at or earlier than the specified time are queried.', example='2019-05-16T10:26:14Z'),
  executedBy?: string(name='ExecutedBy', description='The executor.', example='vme'),
  executionId?: string(name='ExecutionId', description='The ID of the execution.', example='exec-xxx'),
  includeChildExecution?: boolean(name='IncludeChildExecution', description='Specifies whether to include child executions. Default value: False.', example='true'),
  maxResults?: int32(name='MaxResults', description='The number of entries to return on each page. Valid values: 10 to 100. Default value: 50.', example='50'),
  mode?: string(name='Mode', description='The execution mode. Valid values:

*   **Automatic**
*   **Debug**', example='Automatic'),
  nextToken?: string(name='NextToken', description='The token that is used to retrieve the next page of results.', example='MTRBMDc0NjAtRUJFNy00N0NBLTk3NTctMTJDQzQ'),
  parentExecutionId?: string(name='ParentExecutionId', description='The ID of the parent execution.', example='exec-xxx'),
  ramRole?: string(name='RamRole', description='The RAM role.', example='OOSServiceRole'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which the instances you want to query belong.', example='rg-acfmxsn4m4******'),
  resourceId?: string(name='ResourceId', description='The ID of the Elastic Compute Service (ECS) resource.', example='i-xxx'),
  resourceTemplateName?: string(name='ResourceTemplateName', description='The name of the resource template.', example='ACS-ECS-TEST'),
  sortField?: string(name='SortField', description='The field that is used to sort the executions to query. Valid values:

*   **StartDate**: specifies that the executions are sorted based on the time when they are created. This is the default value.
*   **EndDate**: specifies that the executions are sorted based on the time when they stop running.
*   **Status**: specifies that the executions are sorted based on their states.', example='StartDate'),
  sortOrder?: string(name='SortOrder', description='The order in which you want to sort the results. Valid values:

*   **Ascending**: ascending order.
*   **Descending**: descending order. This is the default value.', example='Ascending'),
  startDateAfter?: string(name='StartDateAfter', description='The earliest start time. The executions that start to run at or later than the specified time are queried.', example='2019-05-16T10:26:14Z'),
  startDateBefore?: string(name='StartDateBefore', description='The latest start time. The executions that start to run at or earlier than the specified point in time are queried.', example='2019-05-16T10:26:14Z'),
  status?: string(name='Status', description='The status of the execution. Valid values: Running, Started, Success, Failed, Waiting, Cancelled, Pending, and Skipped.', example='Running'),
  tags?: map[string]any(name='Tags', description='The tags for the execution.', example='{"k1":"v2","k2":"v2"}'),
  templateName?: string(name='TemplateName', description='The name of the template. All templates whose names contain the specified template name are queried.', example='MyTemplate'),
}

model ListExecutionsShrinkRequest {
  categories?: string(name='Categories', description='The types of the execution template. Valid values: Other, TimerTrigger, EventTrigger, and AlarmTrigger. You can specify only one of the Categories and Category parameters. We recommend that you specify Categories.', example='["TimerTrigger"、"EventTrigger"]'),
  category?: string(name='Category', description='The type of the execution template. Valid values: Other, TimerTrigger, EventTrigger, and AlarmTrigger.', example='Other'),
  depth?: string(name='Depth', description='The depth of execution. Valid values: RootDepth and FirstChildDepth. If you set this parameter to RootDepth, only the parent execution is returned. If you set this parameter to FirstChildDepth, only the child executions at the first level are returned. You can specify only one of the Depth and IncludeChildExecution parameters. We recommend that you specify Depth.', example='RootDepth'),
  description?: string(name='Description', description='The description of the execution.', example='MyDescription'),
  endDateAfter?: string(name='EndDateAfter', description='The earliest end time. The executions that stop running at or later than the specified time are queried.', example='2019-05-16T10:26:14Z'),
  endDateBefore?: string(name='EndDateBefore', description='The latest end time. The executions that stop running at or earlier than the specified time are queried.', example='2019-05-16T10:26:14Z'),
  executedBy?: string(name='ExecutedBy', description='The executor.', example='vme'),
  executionId?: string(name='ExecutionId', description='The ID of the execution.', example='exec-xxx'),
  includeChildExecution?: boolean(name='IncludeChildExecution', description='Specifies whether to include child executions. Default value: False.', example='true'),
  maxResults?: int32(name='MaxResults', description='The number of entries to return on each page. Valid values: 10 to 100. Default value: 50.', example='50'),
  mode?: string(name='Mode', description='The execution mode. Valid values:

*   **Automatic**
*   **Debug**', example='Automatic'),
  nextToken?: string(name='NextToken', description='The token that is used to retrieve the next page of results.', example='MTRBMDc0NjAtRUJFNy00N0NBLTk3NTctMTJDQzQ'),
  parentExecutionId?: string(name='ParentExecutionId', description='The ID of the parent execution.', example='exec-xxx'),
  ramRole?: string(name='RamRole', description='The RAM role.', example='OOSServiceRole'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which the instances you want to query belong.', example='rg-acfmxsn4m4******'),
  resourceId?: string(name='ResourceId', description='The ID of the Elastic Compute Service (ECS) resource.', example='i-xxx'),
  resourceTemplateName?: string(name='ResourceTemplateName', description='The name of the resource template.', example='ACS-ECS-TEST'),
  sortField?: string(name='SortField', description='The field that is used to sort the executions to query. Valid values:

*   **StartDate**: specifies that the executions are sorted based on the time when they are created. This is the default value.
*   **EndDate**: specifies that the executions are sorted based on the time when they stop running.
*   **Status**: specifies that the executions are sorted based on their states.', example='StartDate'),
  sortOrder?: string(name='SortOrder', description='The order in which you want to sort the results. Valid values:

*   **Ascending**: ascending order.
*   **Descending**: descending order. This is the default value.', example='Ascending'),
  startDateAfter?: string(name='StartDateAfter', description='The earliest start time. The executions that start to run at or later than the specified time are queried.', example='2019-05-16T10:26:14Z'),
  startDateBefore?: string(name='StartDateBefore', description='The latest start time. The executions that start to run at or earlier than the specified point in time are queried.', example='2019-05-16T10:26:14Z'),
  status?: string(name='Status', description='The status of the execution. Valid values: Running, Started, Success, Failed, Waiting, Cancelled, Pending, and Skipped.', example='Running'),
  tagsShrink?: string(name='Tags', description='The tags for the execution.', example='{"k1":"v2","k2":"v2"}'),
  templateName?: string(name='TemplateName', description='The name of the template. All templates whose names contain the specified template name are queried.', example='MyTemplate'),
}

model ListExecutionsResponseBody = {
  executions?: [ 
    {
      category?: string(name='Category', description='The type of the execution template. Valid values: Other, TimerTrigger, EventTrigger, and AlarmTrigger.', example='Other'),
      counters?: map[string]any(name='Counters', description='The number of tasks that are counted by execution status.', example='{"Failed": 0,"Success": 1,"Total": 2}'),
      createDate?: string(name='CreateDate', description='The time when the execution was created.', example='2019-05-16T10:26:14Z'),
      currentTasks?: [ 
        {
          taskAction?: string(name='TaskAction', description='The execution template of the task.', example='acs::Template'),
          taskExecutionId?: string(name='TaskExecutionId', description='The ID of the task execution.', example='task-exec-44d32b45d2a49899#1'),
          taskName?: string(name='TaskName', description='The name of the task.', example='installSLSILogtail'),
        }
      ](name='CurrentTasks', description='The information about the tasks that are running.'),
      description?: string(name='Description', description='The description of the execution.', example='test execution.'),
      endDate?: string(name='EndDate', description='The time when the execution stops running.', example='2019-05-16T10:26:14Z'),
      executedBy?: string(name='ExecutedBy', description='The account ID of the user who started the execution of the template.', example='1309252800'),
      executionId?: string(name='ExecutionId', description='The unique ID of the execution.', example='exec-44d32b45d2a449e'),
      isParent?: boolean(name='IsParent', description='Indicates whether the execution contains child executions.', example='false'),
      lastSuccessfulTriggerTime?: string(name='LastSuccessfulTriggerTime', description='The time when the template was last successfully triggered.', example='2019-05-27T09:29:18Z'),
      lastTriggerOutputs?: string(name='LastTriggerOutputs', description='The outputs of last trigger.', example='{
      "InstanceId": "i-xxx"
}'),
      lastTriggerStatus?: string(name='LastTriggerStatus', description='The status of the execution after the template was last triggered.', example='Success'),
      lastTriggerStatusMessage?: string(name='LastTriggerStatusMessage', description='The status message of last trigger.', example='""'),
      lastTriggerTime?: string(name='LastTriggerTime', description='The time when the template was last successfully triggered.', example='2019-05-27T09:29:18Z'),
      mode?: string(name='Mode', description='The execution mode.', example='Automatic'),
      nextScheduleTime?: string(name='NextScheduleTime', description='The next schedule time for timer trigger execution.', example='2019-05-16T10:26:14Z'),
      outputs?: string(name='Outputs', description='The output of the execution.', example='{ "InstanceId":"i-xxx" }'),
      parameters?: map[string]any(name='Parameters', description='The input parameters of the execution.', example='{ "Status":"Running" }'),
      parentExecutionId?: string(name='ParentExecutionId', description='The ID of the parent execution.', example='exec-xxx'),
      ramRole?: string(name='RamRole', description='The role that started the execution of the template.', example='OOSServiceRole'),
      resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
      resourceStatus?: string(name='ResourceStatus', description='The status of the resource.', example='{ 			"Success": 1 		}'),
      safetyCheck?: string(name='SafetyCheck', description='The security check mode. Valid values: Skip, and ConfirmEveryHighRiskAction.', example='Skip'),
      startDate?: string(name='StartDate', description='The time when the execution was started.', example='2019-05-16T10:26:14Z'),
      status?: string(name='Status', description='The status of the execution. Valid values: Started, Queued, Running, Waiting, Success, Failed, and Cancelled.', example='Success'),
      statusMessage?: string(name='StatusMessage', description='The status of the task execution.', example='“”'),
      statusReason?: string(name='StatusReason', description='The reason for which the status occurs.', example='""'),
      tags?: map[string]any(name='Tags', description='The tags of the execution.', example='{}'),
      targets?: string(name='Targets', description='The target resource.', example='"{"ResourceType": "ALIYUN::ECS::Instance", "Filters": [{"ResourceIds": ["i-bp14z07dg3464980x72o"], "RegionId": "cn-hangzhou", "Type": "ResourceIds"}]}"'),
      templateId?: string(name='TemplateId', description='The ID of the template.', example='123'),
      templateName?: string(name='TemplateName', description='The name of the template.', example='MyTemplate'),
      templateVersion?: string(name='TemplateVersion', description='The version number of the template.', example='v1'),
      updateDate?: string(name='UpdateDate', description='The time when the execution was updated.', example='2019-05-16T10:26:14Z'),
      waitingStatus?: string(name='WaitingStatus', description='The Waiting state.', example='""'),
    }
  ](name='Executions', description='The details of the task executions.'),
  maxResults?: int32(name='MaxResults', description='The number of entries returned per page.', example='50'),
  nextToken?: string(name='NextToken', description='The token that is used to retrieve the next page of results.', example='MTRBMDc0NjAtRUJFNy00N0NBLTk3NTctMTJDQzQ'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='14A074-47CA-9757-12CC4761D47A'),
  totalCount?: int32(name='TotalCount', description='The total number of the executions.', example='30'),
}

model ListExecutionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListExecutionsResponseBody(name='body'),
}

/**
 * @summary Queries executions. Multiple methods are supported to filter executions.
 *
 * @param tmpReq ListExecutionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListExecutionsResponse
 */
async function listExecutionsWithOptions(tmpReq: ListExecutionsRequest, runtime: Util.RuntimeOptions): ListExecutionsResponse {
  Util.validateModel(tmpReq);
  var request = new ListExecutionsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.tags)) {
    request.tagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tags, 'Tags', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.categories)) {
    query['Categories'] = request.categories;
  }
  if (!Util.isUnset(request.category)) {
    query['Category'] = request.category;
  }
  if (!Util.isUnset(request.depth)) {
    query['Depth'] = request.depth;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.endDateAfter)) {
    query['EndDateAfter'] = request.endDateAfter;
  }
  if (!Util.isUnset(request.endDateBefore)) {
    query['EndDateBefore'] = request.endDateBefore;
  }
  if (!Util.isUnset(request.executedBy)) {
    query['ExecutedBy'] = request.executedBy;
  }
  if (!Util.isUnset(request.executionId)) {
    query['ExecutionId'] = request.executionId;
  }
  if (!Util.isUnset(request.includeChildExecution)) {
    query['IncludeChildExecution'] = request.includeChildExecution;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.mode)) {
    query['Mode'] = request.mode;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.parentExecutionId)) {
    query['ParentExecutionId'] = request.parentExecutionId;
  }
  if (!Util.isUnset(request.ramRole)) {
    query['RamRole'] = request.ramRole;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceTemplateName)) {
    query['ResourceTemplateName'] = request.resourceTemplateName;
  }
  if (!Util.isUnset(request.sortField)) {
    query['SortField'] = request.sortField;
  }
  if (!Util.isUnset(request.sortOrder)) {
    query['SortOrder'] = request.sortOrder;
  }
  if (!Util.isUnset(request.startDateAfter)) {
    query['StartDateAfter'] = request.startDateAfter;
  }
  if (!Util.isUnset(request.startDateBefore)) {
    query['StartDateBefore'] = request.startDateBefore;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.tagsShrink)) {
    query['Tags'] = request.tagsShrink;
  }
  if (!Util.isUnset(request.templateName)) {
    query['TemplateName'] = request.templateName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListExecutions',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries executions. Multiple methods are supported to filter executions.
 *
 * @param request ListExecutionsRequest
 * @return ListExecutionsResponse
 */
async function listExecutions(request: ListExecutionsRequest): ListExecutionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listExecutionsWithOptions(request, runtime);
}

model ListInstancePackageStatesRequest {
  instanceId?: string(name='InstanceId', description='ECS instance ID

This parameter is required.', example='i-bp1cpoxxxwxxxxxxxxxx'),
  maxResults?: int32(name='MaxResults', description='Page size.', example='50'),
  nextToken?: string(name='NextToken', description='Pagination token.', example='MTRBMDc0NjAtRUJFNy00N0NBLTk3NTctzxxxxxxx'),
  regionId?: string(name='RegionId', description='Region ID.', example='cn-hangzhou'),
  templateNames?: string(name='TemplateNames', description='List of extension names', example='["template1","template2"]'),
}

model ListInstancePackageStatesResponseBody = {
  maxResults?: string(name='MaxResults', description='Page size.', example='50'),
  nextToken?: string(name='NextToken', description='Token string for pagination.', example='MTRBMDc0NjAtRUJFNy00N0NBLTk3NTctzxxxxxxx'),
  packageStates?: [ 
    {
      description?: string(name='Description', description='Description', example='template description'),
      parameters?: string(name='Parameters', description='Parameters', example='{}'),
      publisher?: string(name='Publisher', description='Publisher', example='Alibaba Cloud'),
      templateCategory?: string(name='TemplateCategory', description='Template type', example='Package'),
      templateId?: string(name='TemplateId', description='Template ID', example='087b1e11072a40259f6fxxxxxxxxx'),
      templateName?: string(name='TemplateName', description='Template name.', example='ACS-ECS-Docker'),
      templateVersion?: string(name='TemplateVersion', description='Template version number', example='v3'),
      templateVersionName?: string(name='TemplateVersionName', description='Template version name', example='fix bug'),
      updateTime?: string(name='UpdateTime', description='Update time.', example='2024-05-04T11:17:28'),
    }
  ](name='PackageStates', description='List of extensions'),
  requestId?: string(name='RequestId', description='ID of the request', example='1306108F-610C-40FD-AAD5-XXXXXX'),
}

model ListInstancePackageStatesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListInstancePackageStatesResponseBody(name='body'),
}

/**
 * @summary List Instance Package States
 *
 * @param request ListInstancePackageStatesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListInstancePackageStatesResponse
 */
async function listInstancePackageStatesWithOptions(request: ListInstancePackageStatesRequest, runtime: Util.RuntimeOptions): ListInstancePackageStatesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.templateNames)) {
    query['TemplateNames'] = request.templateNames;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListInstancePackageStates',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary List Instance Package States
 *
 * @param request ListInstancePackageStatesRequest
 * @return ListInstancePackageStatesResponse
 */
async function listInstancePackageStates(request: ListInstancePackageStatesRequest): ListInstancePackageStatesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listInstancePackageStatesWithOptions(request, runtime);
}

model ListInstancePatchStatesRequest {
  instanceIds?: string(name='InstanceIds', description='The ID of the Elastic Compute Service (ECS) instance. The value can be a JSON array that consists of up to 100 instance IDs. Separate the instance IDs with commas (,).', example='["i-bp1jaxa2bs4bps7*****", "i-bp67acfmxazb4p****", … "i-bp67acfmxazb4p****"]'),
  maxResults?: int32(name='MaxResults', description='The number of entries to return on each page.', example='50'),
  nextToken?: string(name='NextToken', description='The token that is used to retrieve the next page of results.', example='-'),
  regionId?: string(name='RegionId', description='The ID of the region in which the instance whose patches you want to query resides.', example='cn-hangzhou'),
}

model ListInstancePatchStatesResponseBody = {
  instancePatchStates?: [ 
    {
      baselineId?: string(name='BaselineId', description='The ID of the patch baseline.', example='pb-f9393021b7a049e1b34e'),
      failedCount?: string(name='FailedCount', description='The number of patches that failed to be installed.', example='0'),
      installedCount?: string(name='InstalledCount', description='The number of installed patches.', example='0'),
      installedOtherCount?: string(name='InstalledOtherCount', description='The number of patches that do not meet the baseline.', example='0'),
      installedPendingRebootCount?: string(name='InstalledPendingRebootCount', description='The number of patches that have been installed but require a restart to take effect.', example='0'),
      installedRejectedCount?: string(name='InstalledRejectedCount', description='The number of patches that are rejected by the user.', example='0'),
      instanceId?: string(name='InstanceId', description='The ID of the ECS instance.', example='i-bp1jaxa2bs4bps7*****'),
      missingCount?: string(name='MissingCount', description='The number of patches that are not installed.', example='0'),
      operationEndTime?: string(name='OperationEndTime', description='The time when the operation ended.', example='2021-09-10T11:42:22Z'),
      operationStartTime?: string(name='OperationStartTime', description='The time when the operation was initiated.', example='2021-09-10T11:42:22Z'),
      operationType?: string(name='OperationType', description='The operation type.', example='scan'),
      ownerInformation?: string(name='OwnerInformation', description='The information about the user.', example='“”'),
      patchGroup?: string(name='PatchGroup', description='The patch group.', example='null'),
    }
  ](name='InstancePatchStates', description='The details of patches of the instance.'),
  maxResults?: int32(name='MaxResults', description='The number of entries returned on each page.', example='50'),
  nextToken?: string(name='NextToken', description='The token that is used to retrieve the next page of results.', example='-'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='9A47C086-E64D-52EE-8B2C-EFD23877C55E'),
}

model ListInstancePatchStatesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListInstancePatchStatesResponseBody(name='body'),
}

/**
 * @summary Queries the information about the patches of an instance.
 *
 * @param request ListInstancePatchStatesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListInstancePatchStatesResponse
 */
async function listInstancePatchStatesWithOptions(request: ListInstancePatchStatesRequest, runtime: Util.RuntimeOptions): ListInstancePatchStatesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceIds)) {
    query['InstanceIds'] = request.instanceIds;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListInstancePatchStates',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about the patches of an instance.
 *
 * @param request ListInstancePatchStatesRequest
 * @return ListInstancePatchStatesResponse
 */
async function listInstancePatchStates(request: ListInstancePatchStatesRequest): ListInstancePatchStatesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listInstancePatchStatesWithOptions(request, runtime);
}

model ListInstancePatchesRequest {
  instanceId?: string(name='InstanceId', description='The ID of the instance.', example='i-bp1jaxa2bs4bps7*****'),
  maxResults?: int32(name='MaxResults', description='The number of entries to return on each page.', example='50'),
  nextToken?: string(name='NextToken', description='The token that is used to retrieve the next page of results.', example='gAAAAABfTgv5ewUWmNdJ3g7JVLvX70sPH90GZOVGC6KPDUL0FIIb'),
  patchStatuses?: string(name='PatchStatuses', description='The status of the patches that you want to query. If you do not set this parameter, patches are not filtered.', example='Installed'),
  regionId?: string(name='RegionId', description='The ID of the region in which the instance whose patches you want to query resides.', example='cn-hangzhou'),
}

model ListInstancePatchesResponseBody = {
  maxResults?: int32(name='MaxResults', description='The number of entries returned on each page.', example='50'),
  nextToken?: string(name='NextToken', description='The token that is used to retrieve the next page of results.', example='-'),
  patches?: [ 
    {
      classification?: string(name='Classification', description='The classification of the patch.', example='“”'),
      installedTime?: string(name='InstalledTime', description='The time when the patch was installed.', example='2021-01-28T07:07:20Z'),
      KBId?: string(name='KBId', description='The Id of KBId.', example='apt-utils.amd64'),
      severity?: string(name='Severity', description='The level of the severity.', example='important'),
      status?: string(name='Status', description='The status of the installation.', example='Installed'),
      title?: string(name='Title', description='The name of the patch.', example='isc-dhcp-common.amd64:4.3.5-3ubuntu7.3'),
    }
  ](name='Patches', description='The information about the patch.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='0A615755-9C86-5EA6-BF9E-6E8F1AFF9403'),
}

model ListInstancePatchesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListInstancePatchesResponseBody(name='body'),
}

/**
 * @summary Queries the information about the patches of an instance.
 *
 * @param request ListInstancePatchesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListInstancePatchesResponse
 */
async function listInstancePatchesWithOptions(request: ListInstancePatchesRequest, runtime: Util.RuntimeOptions): ListInstancePatchesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.patchStatuses)) {
    query['PatchStatuses'] = request.patchStatuses;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListInstancePatches',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about the patches of an instance.
 *
 * @param request ListInstancePatchesRequest
 * @return ListInstancePatchesResponse
 */
async function listInstancePatches(request: ListInstancePatchesRequest): ListInstancePatchesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listInstancePatchesWithOptions(request, runtime);
}

model ListInventoryEntriesRequest {
  filter?: [ 
    {
      name?: string(name='Name', description='The name of the component property. Valid values of N: 1 to 5.', example='PlatformName'),
      operator?: string(name='Operator', description='The comparison operator that is used to filter property values. Valid values of N: 1 to 5. Valid values:

*   Equal
*   NotEqual
*   BeginWith
*   LessThan
*   GreaterThan', example='Equal'),
      value?: [ string ](name='Value', description='The values of properties. Valid values of the first N: 1 to 5. Valid values of the second N: 1 to 20.', example='test'),
    }
  ](name='Filter', description='The filter rules for the component.'),
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='i-bp1cpoxxxwxxxxxxxxxx'),
  maxResults?: int32(name='MaxResults', description='The number of entries per page. Valid values: 1 to 100. Default value: 50.', example='50'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request.', example='MTRBMDc0NjAtRUJFNy00N0NBLTk3NTctMTJDQzA'),
  regionId?: string(name='RegionId', description='The ID of the region in which the instance resides.', example='cn-hangzhou'),
  typeName?: string(name='TypeName', description='The name of the component. Valid values:

*   ACS:InstanceInformation
*   ACS:Application
*   ACS:File
*   ACS:Network
*   ACS:WindowsRole
*   ACS:Service
*   ACS:WindowsRegistry
*   ACS:WindowsUpdate

This parameter is required.', example='ACS:InstanceInformation'),
}

model ListInventoryEntriesResponseBody = {
  captureTime?: string(name='CaptureTime', description='The time when the request was sent.', example='2020-09-17T12:28:13Z'),
  entries?: [  map[string]any ](name='Entries', description='The configurations of the component.'),
  instanceId?: string(name='InstanceId', description='The ID of the ECS instance.', example='i-bp1cpoxxxwxxxxxxxxxx'),
  maxResults?: int32(name='MaxResults', description='The number of entries returned per page.', example='50'),
  nextToken?: string(name='NextToken', description='The returned value of NextToken is a pagination token, which can be used in the next request to retrieve a new page of results.', example='gAAAAABfTgv5ewUWmNdJ3g7JVLvX70sPH90GZOVGC'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='A81E4B2E-6B33-4BAE-9856-55DB7C893E01'),
  schemaVersion?: string(name='SchemaVersion', description='The version number of the component.', example='1.0'),
  typeName?: string(name='TypeName', description='The name of the component.', example='ACS:InstanceInformation'),
}

model ListInventoryEntriesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListInventoryEntriesResponseBody(name='body'),
}

/**
 * @summary Queries the configurations of an Elastic Compute Service (ECS) instance.
 *
 * @param request ListInventoryEntriesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListInventoryEntriesResponse
 */
async function listInventoryEntriesWithOptions(request: ListInventoryEntriesRequest, runtime: Util.RuntimeOptions): ListInventoryEntriesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.filter)) {
    query['Filter'] = request.filter;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.typeName)) {
    query['TypeName'] = request.typeName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListInventoryEntries',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the configurations of an Elastic Compute Service (ECS) instance.
 *
 * @param request ListInventoryEntriesRequest
 * @return ListInventoryEntriesResponse
 */
async function listInventoryEntries(request: ListInventoryEntriesRequest): ListInventoryEntriesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listInventoryEntriesWithOptions(request, runtime);
}

model ListOpsItemsRequest {
  filter?: [ 
    {
      name?: string(name='Name', description='The parameter name of the filter.', example='Status'),
      operator?: string(name='Operator', description='The comparison operator that is used to filter property values.', example='Equal'),
      value?: [ string ](name='Value', description='The parameter values of the filter.'),
    }
  ](name='Filter', description='The filter rules for the component.'),
  maxResults?: int32(name='MaxResults', description='The number of entries to return on each page. Valid values: 10 to 100. Default value: 50.', example='50'),
  nextToken?: string(name='NextToken', description='The token that is used to retrieve the next page of results.', example='MTRBMDc0NjAtRUJFNy00N0NBLTk3NTctMTJDQzQ3NjFENDdB'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  resourceTags?: map[string]any(name='ResourceTags', description='The information about resource tags.', example='{
      "k1": "v1",
      "k2": "v2"
}'),
  tags?: map[string]any(name='Tags', description='The tags.', example='{"k1": "v1", "k2": "v2"}'),
}

model ListOpsItemsShrinkRequest {
  filter?: [ 
    {
      name?: string(name='Name', description='The parameter name of the filter.', example='Status'),
      operator?: string(name='Operator', description='The comparison operator that is used to filter property values.', example='Equal'),
      value?: [ string ](name='Value', description='The parameter values of the filter.'),
    }
  ](name='Filter', description='The filter rules for the component.'),
  maxResults?: int32(name='MaxResults', description='The number of entries to return on each page. Valid values: 10 to 100. Default value: 50.', example='50'),
  nextToken?: string(name='NextToken', description='The token that is used to retrieve the next page of results.', example='MTRBMDc0NjAtRUJFNy00N0NBLTk3NTctMTJDQzQ3NjFENDdB'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  resourceTagsShrink?: string(name='ResourceTags', description='The information about resource tags.', example='{
      "k1": "v1",
      "k2": "v2"
}'),
  tagsShrink?: string(name='Tags', description='The tags.', example='{"k1": "v1", "k2": "v2"}'),
}

model ListOpsItemsResponseBody = {
  maxResults?: int32(name='MaxResults', description='The number of entries returned on each page.', example='50'),
  nextToken?: string(name='NextToken', description='The pagination token that can be used in the next request to retrieve a new page of results.', example='gAAAAABfTgv5ewUWmNdJ3g7JVLvX70sPH90GZOVGC6KPDUL0FIIb'),
  opsItems?: [ 
    {
      category?: string(name='Category', description='The category.', example='Security'),
      createDate?: string(name='CreateDate', description='The time when the O\\\\&M item was created.', example='2023-07-09T10:01Z'),
      opsItemId?: string(name='OpsItemId', description='The ID of the O\\\\&M item.', example='oi-d52b08695e2b46ae8413'),
      priority?: int32(name='Priority', description='The priority.', example='1'),
      resources?: [ string ](name='Resources', description='The Alibaba Resource Names (ARNs) of the associated resources.'),
      severity?: string(name='Severity', description='The severity level.', example='Medium'),
      source?: string(name='Source', description='The source business.', example='/aliyun/ecs'),
      status?: string(name='Status', description='The status of the O\\\\&M item.', example='Open'),
      tags?: map[string]any(name='Tags', description='The tags.', example='{"k1":"v1"}'),
      title?: string(name='Title', description='The title of the O\\\\&M item.', example='Test'),
      updateDate?: string(name='UpdateDate', description='The time when the O\\\\&M item was updated.', example='2023-07-09T10:01Z'),
    }
  ](name='OpsItems', description='The list of O\\\\&M items.'),
  requestId?: string(name='RequestId', description='The request ID.', example='113DD533-389C-5F83-9C69-F64D5BAB10B2'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='1'),
}

model ListOpsItemsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListOpsItemsResponseBody(name='body'),
}

/**
 * @summary Queries O\\&M items.
 *
 * @param tmpReq ListOpsItemsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListOpsItemsResponse
 */
async function listOpsItemsWithOptions(tmpReq: ListOpsItemsRequest, runtime: Util.RuntimeOptions): ListOpsItemsResponse {
  Util.validateModel(tmpReq);
  var request = new ListOpsItemsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.resourceTags)) {
    request.resourceTagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.resourceTags, 'ResourceTags', 'json');
  }
  if (!Util.isUnset(tmpReq.tags)) {
    request.tagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tags, 'Tags', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.filter)) {
    query['Filter'] = request.filter;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceTagsShrink)) {
    query['ResourceTags'] = request.resourceTagsShrink;
  }
  if (!Util.isUnset(request.tagsShrink)) {
    query['Tags'] = request.tagsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListOpsItems',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries O\\&M items.
 *
 * @param request ListOpsItemsRequest
 * @return ListOpsItemsResponse
 */
async function listOpsItems(request: ListOpsItemsRequest): ListOpsItemsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listOpsItemsWithOptions(request, runtime);
}

model ListParameterVersionsRequest {
  maxResults?: int32(name='MaxResults', description='The number of entries per page. Valid values: 10 to 100. Default value: 50.', example='50'),
  name?: string(name='Name', description='The name of the common parameter.

This parameter is required.', example='MyParameter'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results.', example='MTRBMDc0NjAtRUJFNy00N0NBLTk3NTctMTJDQzQ3NjFENDdB'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  shareType?: string(name='ShareType', description='The share type of the common parameter.', example='Private'),
}

model ListParameterVersionsResponseBody = {
  createdBy?: string(name='CreatedBy', description='The user who created the common parameter.', example='root(130900000)'),
  createdDate?: string(name='CreatedDate', description='The time when the common parameter was created.', example='2020-09-07T11:37:29Z'),
  description?: string(name='Description', description='The description of the common parameter.', example='parameter-description'),
  id?: string(name='Id', description='The ID of the common parameter.', example='p-a483b520e0axxxxxxxxx'),
  maxResults?: int32(name='MaxResults', description='The number of entries per page.', example='50'),
  name?: string(name='Name', description='The name of the common parameter.', example='MyParameter'),
  nextToken?: string(name='NextToken', description='The pagination token that was used in the next request to retrieve a new page of results.', example='MTRBMDc0NjAtRUJFNy00N0NBLTk3NTctMTJDQzQ3NjFENDdB'),
  parameterVersions?: [ 
    {
      parameterVersion?: int32(name='ParameterVersion', description='The version number of the common parameter.', example='1'),
      updatedBy?: string(name='UpdatedBy', description='The user who updated the common parameter.', example='root(130900000)'),
      updatedDate?: string(name='UpdatedDate', description='The time when the common parameter was last updated.', example='2020-09-07T11:37:29Z'),
      value?: string(name='Value', description='The value of the common parameter.', example='MyParameter'),
    }
  ](name='ParameterVersions', description='The information about the version of the common parameter.'),
  requestId?: string(name='RequestId', description='The request ID.', example='FD08D89D-B6C8-4AA2-A2B4-521D3F4A39FA'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='50'),
  type?: string(name='Type', description='The data type of the common parameter.', example='String'),
}

model ListParameterVersionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListParameterVersionsResponseBody(name='body'),
}

/**
 * @summary Queries the versions of a common parameter.
 *
 * @param request ListParameterVersionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListParameterVersionsResponse
 */
async function listParameterVersionsWithOptions(request: ListParameterVersionsRequest, runtime: Util.RuntimeOptions): ListParameterVersionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.shareType)) {
    query['ShareType'] = request.shareType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListParameterVersions',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the versions of a common parameter.
 *
 * @param request ListParameterVersionsRequest
 * @return ListParameterVersionsResponse
 */
async function listParameterVersions(request: ListParameterVersionsRequest): ListParameterVersionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listParameterVersionsWithOptions(request, runtime);
}

model ListParametersRequest {
  maxResults?: int32(name='MaxResults', description='The number of entries per page. Valid values: 10 to 100. Default value: 50.', example='50'),
  name?: string(name='Name', description='The name of the common parameter.', example='MyParameter'),
  nextToken?: string(name='NextToken', description='The pagination token that can be used in the next request to retrieve a new page of results.', example='MTRBMDc0NjAtRUJFNy00N0NBLTk3NTctMTJDQzA'),
  path?: string(name='Path', description='The path of the parameter. For example, if the name of a parameter is /path/path1/Myparameter, the path of the parameter is /path/path1/.', example='/path1/path2/'),
  recursive?: boolean(name='Recursive', description='Specifies whether to query parameters from all levels of directories in the specified path. Default value: false.', example='false'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-acfmxsn4m4******'),
  shareType?: string(name='ShareType', description='The share type of the common parameter. Valid values:

*   Public
*   Private

Default value: Private.', example='‘Private’'),
  sortField?: string(name='SortField', description='The field used to sort the query results. Valid values:

*   Name
*   CreatedDate', example='Name'),
  sortOrder?: string(name='SortOrder', description='The order in which the entries are sorted. Valid values:

*   Ascending
*   Descending (Default)', example='Descending'),
  tags?: map[string]any(name='Tags', description='The tags.', example='{"k1": "v1", "k2": "v2"}'),
  type?: string(name='Type', description='The data type of the common parameter.', example='String'),
}

model ListParametersShrinkRequest {
  maxResults?: int32(name='MaxResults', description='The number of entries per page. Valid values: 10 to 100. Default value: 50.', example='50'),
  name?: string(name='Name', description='The name of the common parameter.', example='MyParameter'),
  nextToken?: string(name='NextToken', description='The pagination token that can be used in the next request to retrieve a new page of results.', example='MTRBMDc0NjAtRUJFNy00N0NBLTk3NTctMTJDQzA'),
  path?: string(name='Path', description='The path of the parameter. For example, if the name of a parameter is /path/path1/Myparameter, the path of the parameter is /path/path1/.', example='/path1/path2/'),
  recursive?: boolean(name='Recursive', description='Specifies whether to query parameters from all levels of directories in the specified path. Default value: false.', example='false'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-acfmxsn4m4******'),
  shareType?: string(name='ShareType', description='The share type of the common parameter. Valid values:

*   Public
*   Private

Default value: Private.', example='‘Private’'),
  sortField?: string(name='SortField', description='The field used to sort the query results. Valid values:

*   Name
*   CreatedDate', example='Name'),
  sortOrder?: string(name='SortOrder', description='The order in which the entries are sorted. Valid values:

*   Ascending
*   Descending (Default)', example='Descending'),
  tagsShrink?: string(name='Tags', description='The tags.', example='{"k1": "v1", "k2": "v2"}'),
  type?: string(name='Type', description='The data type of the common parameter.', example='String'),
}

model ListParametersResponseBody = {
  maxResults?: int32(name='MaxResults', description='The number of entries per page. Valid values: 10 to 100. Default value: 50.', example='50'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results.', example='gAAAAABfTgv5ewUWmNdJ3g7JVLvX70sPH90GZOVGC6KPDUL0FIIb'),
  parameters?: [ 
    {
      createdBy?: string(name='CreatedBy', description='The user who created the common parameter.', example='root(130900000)'),
      createdDate?: string(name='CreatedDate', description='The time when the common parameter was created.', example='2020-09-01T08:01:43Z'),
      description?: string(name='Description', description='The description of the common parameter.', example='parameter'),
      id?: string(name='Id', description='The common parameter ID.', example='p-4c4b401cab6747xxxxxx'),
      name?: string(name='Name', description='The name of the common parameter.', example='MyParameter'),
      parameterVersion?: string(name='ParameterVersion', description='The version number of the common parameter.', example='1'),
      resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-acfmxsn4m4******'),
      shareType?: string(name='ShareType', description='The share type of the common parameter.', example='Private'),
      tags?: map[string]any(name='Tags', description='The tags added to the common parameter.', example='{"k1": "v1", "k2": "v2"}'),
      type?: string(name='Type', description='The data type of the common parameter.', example='String'),
      updatedBy?: string(name='UpdatedBy', description='The user who updated the common parameter.', example='root(130900000)'),
      updatedDate?: string(name='UpdatedDate', description='The time when the common parameter was updated.', example='2020-09-01T08:01:43Z'),
    }
  ](name='Parameters', description='The information about the common parameter.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='A81E4B2E-6B33-4BAE-9856-55DB7C893E01'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='5'),
}

model ListParametersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListParametersResponseBody(name='body'),
}

/**
 * @summary Queries common parameters. Multiple methods are supported to filter common parameters.
 *
 * @param tmpReq ListParametersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListParametersResponse
 */
async function listParametersWithOptions(tmpReq: ListParametersRequest, runtime: Util.RuntimeOptions): ListParametersResponse {
  Util.validateModel(tmpReq);
  var request = new ListParametersShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.tags)) {
    request.tagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tags, 'Tags', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.path)) {
    query['Path'] = request.path;
  }
  if (!Util.isUnset(request.recursive)) {
    query['Recursive'] = request.recursive;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.shareType)) {
    query['ShareType'] = request.shareType;
  }
  if (!Util.isUnset(request.sortField)) {
    query['SortField'] = request.sortField;
  }
  if (!Util.isUnset(request.sortOrder)) {
    query['SortOrder'] = request.sortOrder;
  }
  if (!Util.isUnset(request.tagsShrink)) {
    query['Tags'] = request.tagsShrink;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListParameters',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries common parameters. Multiple methods are supported to filter common parameters.
 *
 * @param request ListParametersRequest
 * @return ListParametersResponse
 */
async function listParameters(request: ListParametersRequest): ListParametersResponse {
  var runtime = new Util.RuntimeOptions{};
  return listParametersWithOptions(request, runtime);
}

model ListPatchBaselinesRequest {
  approvedPatches?: [ string ](name='ApprovedPatches', description='The approved patches.'),
  approvedPatchesEnableNonSecurity?: boolean(name='ApprovedPatchesEnableNonSecurity', description='Specifies whether the approved patch involves updates other than security-related updates.', example='true'),
  maxResults?: int32(name='MaxResults', description='The number of entries returned per page.', example='50'),
  name?: string(name='Name', description='The name of the patch baseline.', example='MyPatchBaseline'),
  nextToken?: string(name='NextToken', description='The token that is used to retrieve the next page of results.', example='-'),
  operationSystem?: string(name='OperationSystem', description='The type of the operating system. Valid values:

*   Windows
*   Ubuntu
*   CentOS
*   Debian
*   AliyunLinux
*   RedhatEnterpriseLinux
*   Anolis
*   AlmaLinux', example='AliyunLinux'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
  shareType?: string(name='ShareType', description='The share type of the template. Valid values:

*   **Public**
*   **Private**', example='Private'),
  sources?: [ string ](name='Sources', description='The patch source configurations.'),
  tags?: [ 
    {
      key?: string(name='Key', description='The key of the tag.', example='key'),
      value?: string(name='Value', description='The value of the tag.', example='value'),
    }
  ](name='Tags', description='The tags.'),
}

model ListPatchBaselinesShrinkRequest {
  approvedPatchesShrink?: string(name='ApprovedPatches', description='The approved patches.'),
  approvedPatchesEnableNonSecurity?: boolean(name='ApprovedPatchesEnableNonSecurity', description='Specifies whether the approved patch involves updates other than security-related updates.', example='true'),
  maxResults?: int32(name='MaxResults', description='The number of entries returned per page.', example='50'),
  name?: string(name='Name', description='The name of the patch baseline.', example='MyPatchBaseline'),
  nextToken?: string(name='NextToken', description='The token that is used to retrieve the next page of results.', example='-'),
  operationSystem?: string(name='OperationSystem', description='The type of the operating system. Valid values:

*   Windows
*   Ubuntu
*   CentOS
*   Debian
*   AliyunLinux
*   RedhatEnterpriseLinux
*   Anolis
*   AlmaLinux', example='AliyunLinux'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
  shareType?: string(name='ShareType', description='The share type of the template. Valid values:

*   **Public**
*   **Private**', example='Private'),
  sourcesShrink?: string(name='Sources', description='The patch source configurations.'),
  tagsShrink?: string(name='Tags', description='The tags.'),
}

model ListPatchBaselinesResponseBody = {
  maxResults?: int32(name='MaxResults', description='The number of entries per page.', example='50'),
  nextToken?: string(name='NextToken', description='The token that is used to retrieve the next page of results.', example='The number of entries returned on each page.'),
  patchBaselines?: [ 
    {
      approvedPatches?: [ string ](name='ApprovedPatches', description='The approved patches.'),
      approvedPatchesEnableNonSecurity?: boolean(name='ApprovedPatchesEnableNonSecurity', description='Indicates whether the approved patch involves updates other than security-related updates.', example='true'),
      createdBy?: string(name='CreatedBy', description='The user who created the patch baseline.', example='root(130900000)'),
      createdDate?: string(name='CreatedDate', description='The time when the patch baseline was created.', example='2021-09-08T03:41:23Z'),
      description?: string(name='Description', description='The description of the patch baseline.', example='ListPatchBaseline'),
      id?: string(name='Id', description='The ID of the patch baseline.', example='pb-c2838b5d89b540e19ee6'),
      isDefault?: boolean(name='IsDefault', description='Indicates whether the patch baseline is set as the default patch baseline.', example='false'),
      name?: string(name='Name', description='The name of the patch baseline.', example='MyPatchBaseline'),
      operationSystem?: string(name='OperationSystem', description='The type of the operating system.', example='AliyunLinux'),
      resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-aek256ia6vhsndy'),
      shareType?: string(name='ShareType', description='The share type of the patch baseline.', example='Private'),
      sources?: [ string ](name='Sources', description='The configurations of patch sources.'),
      tags?: [ 
        {
          tagKey?: string(name='TagKey', description='The key of the tag.', example='key'),
          tagValue?: string(name='TagValue', description='The value of the tag.', example='value'),
        }
      ](name='Tags', description='The tags of the patch baseline.'),
      updatedBy?: string(name='UpdatedBy', description='The user who last updated the patch baseline.', example='root(130900000)'),
      updatedDate?: string(name='UpdatedDate', description='The time when the patch baseline was updated.', example='2021-09-08T03:44:34Z'),
    }
  ](name='PatchBaselines', description='The patch baselines.'),
  requestId?: string(name='RequestId', description='The request ID.', example='432996A1-03C0-5C4C-A8E6-66C4110765B8'),
}

model ListPatchBaselinesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListPatchBaselinesResponseBody(name='body'),
}

/**
 * @summary Queries a list of patch baselines.
 *
 * @param tmpReq ListPatchBaselinesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListPatchBaselinesResponse
 */
async function listPatchBaselinesWithOptions(tmpReq: ListPatchBaselinesRequest, runtime: Util.RuntimeOptions): ListPatchBaselinesResponse {
  Util.validateModel(tmpReq);
  var request = new ListPatchBaselinesShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.approvedPatches)) {
    request.approvedPatchesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.approvedPatches, 'ApprovedPatches', 'json');
  }
  if (!Util.isUnset(tmpReq.sources)) {
    request.sourcesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.sources, 'Sources', 'json');
  }
  if (!Util.isUnset(tmpReq.tags)) {
    request.tagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tags, 'Tags', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.approvedPatchesShrink)) {
    query['ApprovedPatches'] = request.approvedPatchesShrink;
  }
  if (!Util.isUnset(request.approvedPatchesEnableNonSecurity)) {
    query['ApprovedPatchesEnableNonSecurity'] = request.approvedPatchesEnableNonSecurity;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.operationSystem)) {
    query['OperationSystem'] = request.operationSystem;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.shareType)) {
    query['ShareType'] = request.shareType;
  }
  if (!Util.isUnset(request.sourcesShrink)) {
    query['Sources'] = request.sourcesShrink;
  }
  if (!Util.isUnset(request.tagsShrink)) {
    query['Tags'] = request.tagsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListPatchBaselines',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of patch baselines.
 *
 * @param request ListPatchBaselinesRequest
 * @return ListPatchBaselinesResponse
 */
async function listPatchBaselines(request: ListPatchBaselinesRequest): ListPatchBaselinesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listPatchBaselinesWithOptions(request, runtime);
}

model ListResourceExecutionStatusRequest {
  executionId?: string(name='ExecutionId', description='The ID of the execution.

This parameter is required.', example='exec-xxxxxxxxxxxx'),
  maxResults?: int32(name='MaxResults', description='The number of entries to return on each page. Valid values: 10 to 100. Default value: 50.', example='50'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results.', example='MTRBMDc0NjAtRUJFNy00N0NBLTk3NTctMTJDQzQ'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
}

model ListResourceExecutionStatusResponseBody = {
  maxResults?: int32(name='MaxResults', description='The number of entries returned on each page.', example='50'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results.', example='MTRBMDc0NjAtRUJFNy00N0NBLTk3NTctMTJDQzQ'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='ED571CBD-9F96-419D-B919-CF340BBCA157'),
  resourceExecutionStatus?: [ 
    {
      executionId?: string(name='ExecutionId', description='The ID of the execution.', example='exec-6be6d6ff805349d9ac13'),
      executionTime?: string(name='ExecutionTime', description='The time when the execution started running.', example='2020-11-13T08:48:34Z'),
      outputs?: string(name='Outputs', description='The output of the template.', example='{ 				"commandOutput": "hello\\\\n" 			}'),
      resourceId?: string(name='ResourceId', description='The ID of the resource.', example='i-bp1e1bxxxxxxxxxxxxxx'),
      status?: string(name='Status', description='The status of the execution.', example='Success'),
    }
  ](name='ResourceExecutionStatus', description='The execution information of the resource.'),
}

model ListResourceExecutionStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListResourceExecutionStatusResponseBody(name='body'),
}

/**
 * @summary Queries the information about a scheduled execution that involves O&M operations on Elastic Compute Service (ECS) instances.
 *
 * @param request ListResourceExecutionStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListResourceExecutionStatusResponse
 */
async function listResourceExecutionStatusWithOptions(request: ListResourceExecutionStatusRequest, runtime: Util.RuntimeOptions): ListResourceExecutionStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.executionId)) {
    query['ExecutionId'] = request.executionId;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListResourceExecutionStatus',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about a scheduled execution that involves O&M operations on Elastic Compute Service (ECS) instances.
 *
 * @param request ListResourceExecutionStatusRequest
 * @return ListResourceExecutionStatusResponse
 */
async function listResourceExecutionStatus(request: ListResourceExecutionStatusRequest): ListResourceExecutionStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return listResourceExecutionStatusWithOptions(request, runtime);
}

model ListSecretParameterVersionsRequest {
  maxResults?: int32(name='MaxResults', description='The number of entries per page. Valid values: 10 to 100. Default value: 50.', example='10'),
  name?: string(name='Name', description='The name of the encryption parameter.

This parameter is required.', example='MySecretParameter'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results.', example='MTRBMDc0NjAtRUJFNy00N0NBLTk3NTctMTJDQzQ3NjFENDdB'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
  shareType?: string(name='ShareType', description='The share type of the encryption parameter.', example='Private'),
  withDecryption?: boolean(name='WithDecryption', description='Specifies whether to decrypt the parameter value. The decrypted parameter value is returned only if this parameter is set to true. Otherwise, null is returned.', example='false'),
}

model ListSecretParameterVersionsResponseBody = {
  createdBy?: string(name='CreatedBy', description='The user who created the encryption parameter.', example='root(130900000)'),
  createdDate?: string(name='CreatedDate', description='The time when the encryption parameter was created.', example='2020-09-01T08:01:43Z'),
  description?: string(name='Description', description='The description of the encryption parameter.', example='SecretParameter'),
  id?: string(name='Id', description='The ID of the encryption parameter.', example='p-4c4b401cab6747xxxxxx'),
  maxResults?: int32(name='MaxResults', description='The number of entries returned per page.', example='50'),
  name?: string(name='Name', description='The name of the encryption parameter.', example='MySecretParameter'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results.', example='MTRBMDc0NjAtRUJFNy00N0NBLTk3NTctMTJDQzQ3NjFENDdB'),
  parameterVersions?: [ 
    {
      parameterVersion?: int32(name='ParameterVersion', description='The version number of the encryption parameter.', example='1'),
      updatedBy?: string(name='UpdatedBy', description='The user who updated the encryption parameter.', example='root(130900000)'),
      updatedDate?: string(name='UpdatedDate', description='The time when the encryption parameter was updated.', example='2020-09-01T08:01:43Z'),
      value?: string(name='Value', description='The value of the encryption parameter.', example='SecretParameter'),
    }
  ](name='ParameterVersions', description='The information about the version of the encryption parameter.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='DBA6E6C8-F75D-41DE-AFF5-1FA03F551CA3'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='1'),
  type?: string(name='Type', description='The type of the encryption parameter.', example='Secret'),
}

model ListSecretParameterVersionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSecretParameterVersionsResponseBody(name='body'),
}

/**
 * @summary Queries versions of an encryption parameter.
 *
 * @param request ListSecretParameterVersionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSecretParameterVersionsResponse
 */
async function listSecretParameterVersionsWithOptions(request: ListSecretParameterVersionsRequest, runtime: Util.RuntimeOptions): ListSecretParameterVersionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.shareType)) {
    query['ShareType'] = request.shareType;
  }
  if (!Util.isUnset(request.withDecryption)) {
    query['WithDecryption'] = request.withDecryption;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListSecretParameterVersions',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries versions of an encryption parameter.
 *
 * @param request ListSecretParameterVersionsRequest
 * @return ListSecretParameterVersionsResponse
 */
async function listSecretParameterVersions(request: ListSecretParameterVersionsRequest): ListSecretParameterVersionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listSecretParameterVersionsWithOptions(request, runtime);
}

model ListSecretParametersRequest {
  maxResults?: int32(name='MaxResults', description='The number of entries per page. Valid values: 10 to 100. Default value: 50.', example='50'),
  name?: string(name='Name', description='The name of the parameter. **You can enter a keyword to query parameter names in fuzzy match mode.', example='MySecretParameter'),
  nextToken?: string(name='NextToken', description='The token that is used to retrieve the next page of results.', example='sPH90GZOVGC6KPDUL0FIIbEtMQHq_19S6_4O_XqA'),
  path?: string(name='Path', description='The path of the parameter. For example, if the name of a parameter is /path/path1/Myparameter, the path of the parameter is /path/path1/.', example='/path1/path2/'),
  recursive?: boolean(name='Recursive', description='Specifies whether to query parameters from all levels of directories in the specified path. Default value: false.', example='false'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
  sortField?: string(name='SortField', description='The field used to sort the query results. Valid values:

*   Name
*   CreatedDate', example='Name'),
  sortOrder?: string(name='SortOrder', description='The order in which the entries are sorted. Valid values:

*   Ascending
*   Descending (Default)', example='Descending'),
  tags?: map[string]any(name='Tags', description='The tags of the parameter.', example='{"k1": "v1", "k2": "v2"}'),
}

model ListSecretParametersShrinkRequest {
  maxResults?: int32(name='MaxResults', description='The number of entries per page. Valid values: 10 to 100. Default value: 50.', example='50'),
  name?: string(name='Name', description='The name of the parameter. **You can enter a keyword to query parameter names in fuzzy match mode.', example='MySecretParameter'),
  nextToken?: string(name='NextToken', description='The token that is used to retrieve the next page of results.', example='sPH90GZOVGC6KPDUL0FIIbEtMQHq_19S6_4O_XqA'),
  path?: string(name='Path', description='The path of the parameter. For example, if the name of a parameter is /path/path1/Myparameter, the path of the parameter is /path/path1/.', example='/path1/path2/'),
  recursive?: boolean(name='Recursive', description='Specifies whether to query parameters from all levels of directories in the specified path. Default value: false.', example='false'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
  sortField?: string(name='SortField', description='The field used to sort the query results. Valid values:

*   Name
*   CreatedDate', example='Name'),
  sortOrder?: string(name='SortOrder', description='The order in which the entries are sorted. Valid values:

*   Ascending
*   Descending (Default)', example='Descending'),
  tagsShrink?: string(name='Tags', description='The tags of the parameter.', example='{"k1": "v1", "k2": "v2"}'),
}

model ListSecretParametersResponseBody = {
  maxResults?: int32(name='MaxResults', description='The number of entries returned per page.', example='50'),
  nextToken?: string(name='NextToken', description='The token that is used to retrieve the next page of results.', example='sPH90GZOVGC6KPDUL0FIIbEtMQHq_19S6_4O_XqA'),
  parameters?: [ 
    {
      createdBy?: string(name='CreatedBy', description='The user who created the parameter.', example='root(130900000)'),
      createdDate?: string(name='CreatedDate', description='The time when the parameter was created.', example='2020-09-01T09:28:47Z'),
      description?: string(name='Description', description='The description of the parameter.', example='SecretParameter'),
      id?: string(name='Id', description='The ID of the parameter.', example='p-14ed150fdcd048xxxxxx'),
      keyId?: string(name='KeyId', description='The ID of the KMS customer master key (CMK) that is used for encryption.', example='80e9409f-78fa-42ab-84bd-83f40c******'),
      name?: string(name='Name', description='The name of the parameter.', example='MySecretParameter'),
      parameterVersion?: string(name='ParameterVersion', description='The version number of the parameter.', example='1'),
      resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
      shareType?: string(name='ShareType', description='The share type of the parameter.', example='Private'),
      tags?: map[string]any(name='Tags', description='The tags of the parameter.', example='{"k1": "v1", "k2": "v2"}'),
      type?: string(name='Type', description='The type of the parameter.', example='Secret'),
      updatedBy?: string(name='UpdatedBy', description='The user who updated the parameter.', example='root(130900000)'),
      updatedDate?: string(name='UpdatedDate', description='The time when the parameter was updated.', example='2020-09-01T09:35:17Z'),
    }
  ](name='Parameters', description='The information about the parameters.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='CA9C6248-AF2A-4AE9-A166-88FD901BBB90'),
}

model ListSecretParametersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSecretParametersResponseBody(name='body'),
}

/**
 * @summary Queries common parameters. Multiple types of queries are supported.
 *
 * @description Before you call this operation, make sure that you have the permission to manage Key Management Service (KMS) secrets.
 *
 * @param tmpReq ListSecretParametersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSecretParametersResponse
 */
async function listSecretParametersWithOptions(tmpReq: ListSecretParametersRequest, runtime: Util.RuntimeOptions): ListSecretParametersResponse {
  Util.validateModel(tmpReq);
  var request = new ListSecretParametersShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.tags)) {
    request.tagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tags, 'Tags', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.path)) {
    query['Path'] = request.path;
  }
  if (!Util.isUnset(request.recursive)) {
    query['Recursive'] = request.recursive;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.sortField)) {
    query['SortField'] = request.sortField;
  }
  if (!Util.isUnset(request.sortOrder)) {
    query['SortOrder'] = request.sortOrder;
  }
  if (!Util.isUnset(request.tagsShrink)) {
    query['Tags'] = request.tagsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListSecretParameters',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries common parameters. Multiple types of queries are supported.
 *
 * @description Before you call this operation, make sure that you have the permission to manage Key Management Service (KMS) secrets.
 *
 * @param request ListSecretParametersRequest
 * @return ListSecretParametersResponse
 */
async function listSecretParameters(request: ListSecretParametersRequest): ListSecretParametersResponse {
  var runtime = new Util.RuntimeOptions{};
  return listSecretParametersWithOptions(request, runtime);
}

model ListStateConfigurationsRequest {
  maxResults?: int32(name='MaxResults', description='The maximum number of entries per page.', example='50'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results.', example='AHJKH-AHKJHDJK-AKHDIOWJL'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-acfmxsn4m4******'),
  stateConfigurationIds?: string(name='StateConfigurationIds', description='The ID of the desired-state configuration.', example='["sc-asfgdhj12345"]'),
  tags?: map[string]any(name='Tags', description='The tags to be added to the configuration.', example='{"Key": "oos", "Value": "inventory"}'),
  templateName?: string(name='TemplateName', description='The name of the template. The name must be 1 to 200 characters in length and can contain letters, digits, hyphens (-), and underscores (_).', example='ACS-ECS-InventoryDataCollection'),
  templateVersion?: string(name='TemplateVersion', description='The version number of the template. If you do not specify this parameter, the latest version of the template is used.', example='v1'),
}

model ListStateConfigurationsShrinkRequest {
  maxResults?: int32(name='MaxResults', description='The maximum number of entries per page.', example='50'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results.', example='AHJKH-AHKJHDJK-AKHDIOWJL'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-acfmxsn4m4******'),
  stateConfigurationIds?: string(name='StateConfigurationIds', description='The ID of the desired-state configuration.', example='["sc-asfgdhj12345"]'),
  tagsShrink?: string(name='Tags', description='The tags to be added to the configuration.', example='{"Key": "oos", "Value": "inventory"}'),
  templateName?: string(name='TemplateName', description='The name of the template. The name must be 1 to 200 characters in length and can contain letters, digits, hyphens (-), and underscores (_).', example='ACS-ECS-InventoryDataCollection'),
  templateVersion?: string(name='TemplateVersion', description='The version number of the template. If you do not specify this parameter, the latest version of the template is used.', example='v1'),
}

model ListStateConfigurationsResponseBody = {
  nextToken?: string(name='NextToken', description='The pagination token that was used in the next request to retrieve a new page of results.', example='AAAAASO3cL82+b5iji7bfPNpMh8='),
  requestId?: string(name='RequestId', description='The request ID.', example='1306108F-610C-40FD-AAD5-DA13E8B00BE9'),
  stateConfigurations?: [ 
    {
      configureMode?: string(name='ConfigureMode', description='The configuration mode. Valid values:', example='ApplyAndAutoCorrect'),
      createTime?: string(name='CreateTime', description='The time when the desired-state configuration was created.', example='2021-03-22T03:13:32Z'),
      description?: string(name='Description', description='The description.', example='Collect inventory data'),
      parameters?: string(name='Parameters', description='The parameters.', example='{"policy": {"ACS:Network": {"Collection": "Enabled"}, "ACS:Application": {"Collection": "Enabled"}}}'),
      resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-acfmxsn4m4******'),
      scheduleExpression?: string(name='ScheduleExpression', description='The schedule expression.', example='1 hour'),
      scheduleType?: string(name='ScheduleType', description='The schedule type.', example='rate'),
      stateConfigurationId?: string(name='StateConfigurationId', description='The ID of the desired-state configuration.', example='sc-a538febe18fabcdef'),
      tags?: map[string]any(name='Tags', description='The tags added to the configuration.', example='{"Key": "oos", "Value": "inventory"}'),
      targets?: string(name='Targets', description='The queried resources.', example='{ "ResourceType": "ALIYUN::ECS::Instance", "Filters": [ { "Type": "All", "RegionId": "cn-hangzhou", "Parameters": { "RegionId": "cn-hangzhou", "Status": "Running" } } ] }'),
      templateId?: string(name='TemplateId', description='The template ID.', example='t-ajshjalscfhjk2214'),
      templateName?: string(name='TemplateName', description='The name of the template.', example='ACS-ECS-InventoryDataCollection'),
      templateVersion?: string(name='TemplateVersion', description='The version of the template.', example='v2'),
      updateTime?: string(name='UpdateTime', description='The time when the configuration was updated.', example='2021-04-22T03:13:32Z'),
    }
  ](name='StateConfigurations', description='The information about the desired-state configurations.'),
}

model ListStateConfigurationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListStateConfigurationsResponseBody(name='body'),
}

/**
 * @summary Queries desired-state configurations.
 *
 * @param tmpReq ListStateConfigurationsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListStateConfigurationsResponse
 */
async function listStateConfigurationsWithOptions(tmpReq: ListStateConfigurationsRequest, runtime: Util.RuntimeOptions): ListStateConfigurationsResponse {
  Util.validateModel(tmpReq);
  var request = new ListStateConfigurationsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.tags)) {
    request.tagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tags, 'Tags', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.stateConfigurationIds)) {
    query['StateConfigurationIds'] = request.stateConfigurationIds;
  }
  if (!Util.isUnset(request.tagsShrink)) {
    query['Tags'] = request.tagsShrink;
  }
  if (!Util.isUnset(request.templateName)) {
    query['TemplateName'] = request.templateName;
  }
  if (!Util.isUnset(request.templateVersion)) {
    query['TemplateVersion'] = request.templateVersion;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListStateConfigurations',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries desired-state configurations.
 *
 * @param request ListStateConfigurationsRequest
 * @return ListStateConfigurationsResponse
 */
async function listStateConfigurations(request: ListStateConfigurationsRequest): ListStateConfigurationsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listStateConfigurationsWithOptions(request, runtime);
}

model ListTagKeysRequest {
  maxResults?: int32(name='MaxResults', description='The maximum number of entries to return on each page. Valid value: 10 to 100. Default value: 50.', example='50'),
  nextToken?: string(name='NextToken', description='The token that is used to retrieve the next page.', example='djsdlkasd'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
  resourceType?: string(name='ResourceType', description='The type of the resource to which the tag is added.', example='template'),
}

model ListTagKeysResponseBody = {
  keys?: [ string ](name='Keys', description='The tag keys.'),
  maxResults?: int32(name='MaxResults', description='The maximum number of entries to return on each page.', example='50'),
  nextToken?: string(name='NextToken', description='The token that is used to retrieve the next page.', example='87y29h80h20h3f2'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='36210B73-8262-4D08-9D3A-7F96789733C8'),
}

model ListTagKeysResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTagKeysResponseBody(name='body'),
}

/**
 * @summary Queries the tags.
 *
 * @param request ListTagKeysRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTagKeysResponse
 */
async function listTagKeysWithOptions(request: ListTagKeysRequest, runtime: Util.RuntimeOptions): ListTagKeysResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTagKeys',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the tags.
 *
 * @param request ListTagKeysRequest
 * @return ListTagKeysResponse
 */
async function listTagKeys(request: ListTagKeysRequest): ListTagKeysResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTagKeysWithOptions(request, runtime);
}

model ListTagResourcesRequest {
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request.', example='MTRBMDc0NjAtRUJFNy00N0NBLTk3NTctMTJDQzQ'),
  regionId?: string(name='RegionId', description='The ID of the region.

This parameter is required.', example='cn-hangzhou'),
  resourceIds?: map[string]any(name='ResourceIds', description='The IDs of resources. The number of resource IDs ranges from 1 to 50.', example='["templateNam1","templateName2"]'),
  resourceType?: string(name='ResourceType', description='The type of the resource. Valid values: template execution

This parameter is required.', example='template'),
  tags?: map[string]any(name='Tags', description='The tag keys and values. The number of key-value pairs ranges from 1 to 20.', example='{"k1":"v2","k2":"v2"}'),
}

model ListTagResourcesShrinkRequest {
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request.', example='MTRBMDc0NjAtRUJFNy00N0NBLTk3NTctMTJDQzQ'),
  regionId?: string(name='RegionId', description='The ID of the region.

This parameter is required.', example='cn-hangzhou'),
  resourceIdsShrink?: string(name='ResourceIds', description='The IDs of resources. The number of resource IDs ranges from 1 to 50.', example='["templateNam1","templateName2"]'),
  resourceType?: string(name='ResourceType', description='The type of the resource. Valid values: template execution

This parameter is required.', example='template'),
  tagsShrink?: string(name='Tags', description='The tag keys and values. The number of key-value pairs ranges from 1 to 20.', example='{"k1":"v2","k2":"v2"}'),
}

model ListTagResourcesResponseBody = {
  nextToken?: string(name='NextToken', description='The returned value of NextToken is a pagination token, which can be used in the next request to retrieve a new page of results. If the return value of the NextToken parameter is empty, the next page does not exist.', example='MTRBMDc0NjAtRUJFNy00N0NBLTk3NTctMTJDQzQ'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='A5EF78C1-67FC-4E36-A6A8-7DF9C51726DF'),
  tagResources?: {
    tagResource?: [ 
    {
      resourceId?: string(name='ResourceId', description='The ID of the resource.', example='TagTest2'),
      resourceType?: string(name='ResourceType', description='The type of the resource.', example='template'),
      tagKey?: string(name='TagKey', description='The tag key.', example='k1'),
      tagValue?: string(name='TagValue', description='The tag value.', example='v1'),
    }
  ](name='TagResource')
  }(name='TagResources', description='The set of resources and the tags that are added to the resources.'),
}

model ListTagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTagResourcesResponseBody(name='body'),
}

/**
 * @summary Queries the tags that are added to one or more resources.
 *
 * @param tmpReq ListTagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTagResourcesResponse
 */
async function listTagResourcesWithOptions(tmpReq: ListTagResourcesRequest, runtime: Util.RuntimeOptions): ListTagResourcesResponse {
  Util.validateModel(tmpReq);
  var request = new ListTagResourcesShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.resourceIds)) {
    request.resourceIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.resourceIds, 'ResourceIds', 'json');
  }
  if (!Util.isUnset(tmpReq.tags)) {
    request.tagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tags, 'Tags', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceIdsShrink)) {
    query['ResourceIds'] = request.resourceIdsShrink;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.tagsShrink)) {
    query['Tags'] = request.tagsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTagResources',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the tags that are added to one or more resources.
 *
 * @param request ListTagResourcesRequest
 * @return ListTagResourcesResponse
 */
async function listTagResources(request: ListTagResourcesRequest): ListTagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTagResourcesWithOptions(request, runtime);
}

model ListTagValuesRequest {
  key?: string(name='Key', description='The tag key to query.', example='k1'),
  maxResults?: int32(name='MaxResults', description='The maximum number of results on each page.', example='50'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request.', example='3272h923879hsaksad'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
  resourceType?: string(name='ResourceType', description='The type of the tagged resource.', example='template'),
}

model ListTagValuesResponseBody = {
  maxResults?: int32(name='MaxResults', description='The maximum number of results on each page.', example='50'),
  nextToken?: string(name='NextToken', description='The returned value of NextToken is a pagination token, which can be used in the next request to retrieve a new page of results.', example='83u29j2dj3dskds'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='65591133-1188-4935-B78F-20F72'),
  values?: [ string ](name='Values', description='The tag values returned.'),
}

model ListTagValuesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTagValuesResponseBody(name='body'),
}

/**
 * @summary Queries the values of created tags.
 *
 * @param request ListTagValuesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTagValuesResponse
 */
async function listTagValuesWithOptions(request: ListTagValuesRequest, runtime: Util.RuntimeOptions): ListTagValuesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.key)) {
    query['Key'] = request.key;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTagValues',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the values of created tags.
 *
 * @param request ListTagValuesRequest
 * @return ListTagValuesResponse
 */
async function listTagValues(request: ListTagValuesRequest): ListTagValuesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTagValuesWithOptions(request, runtime);
}

model ListTaskExecutionsRequest {
  endDateAfter?: string(name='EndDateAfter', description='The execution ID of the task.', example='2019-05-16T10:26:14Z'),
  endDateBefore?: string(name='EndDateBefore', description='Specifies to query task executions that stop running at or later than the specified time.', example='2019-05-16T10:26:14Z'),
  executionId?: string(name='ExecutionId', description='The status of the execution. Valid values: Running, Started, Success, Failed, Waiting, Cancelled, Pending, and Skipped.', example='exec-xxx'),
  includeChildTaskExecution?: boolean(name='IncludeChildTaskExecution', description='The number of entries to return on each page. Valid values: 20 to 100. Default value: 50.', example='false'),
  maxResults?: int32(name='MaxResults', description='The token that is used to retrieve the next page of results.', example='50'),
  nextToken?: string(name='NextToken', description='Sorts the task executions to query. Valid values:

*   **StartDate**: specifies that the task executions are sorted based on the time when they are created. This is the default value.
*   **EndDate**: specifies that the task executions are sorted based on the time when the time when they stop running.
*   **Status**: specifies that the task executions are sorted based on their statuses.', example='MTRBMDc0NjAtRUJFNy00N0NBLTk3NTctMTJDQzQ3NjFENDdB'),
  parentTaskExecutionId?: string(name='ParentTaskExecutionId', description='Specifies whether to show the child nodes in the loop task. Default value: False.', example='task-exec-xxx'),
  regionId?: string(name='RegionId', description='The ID of the execution.', example='cn-hangzhou'),
  sortField?: string(name='SortField', description='The order in which you want to sort the task executions to query. Valid values:

*   **Ascending**: ascending order.
*   **Descending**: descending order. This is the default value.', example='StartDate'),
  sortOrder?: string(name='SortOrder', description='The token that is used to retrieve the next page of results.', example='Ascending'),
  startDateAfter?: string(name='StartDateAfter', description='Specifies to query task executions that stop running at or before the specified time.', example='2019-05-16T10:26:14Z'),
  startDateBefore?: string(name='StartDateBefore', description='Specifies to query task executions that start to run at or later than the specified time.', example='2019-05-16T10:26:14Z'),
  status?: string(name='Status', description='Specifies to query task executions that start to run at or before the specified time.', example='Running'),
  taskAction?: string(name='TaskAction', description='The execution ID of the parent node. In a loop task, set this parameter to the execution ID of the parent node.', example='ACS::Sleep'),
  taskExecutionId?: string(name='TaskExecutionId', description='The name of the task.', example='task-exec-xxx'),
  taskName?: string(name='TaskName', description='The action of the task.', example='describeInstance'),
}

model ListTaskExecutionsResponseBody = {
  maxResults?: int32(name='MaxResults', description='The details of the task executions.', example='50'),
  nextToken?: string(name='NextToken', description='The ID of the request.', example='MTRBMDc0NjAtRUJFNy00N0NBLTk3NTctMTJDQzQ3NjFENDdB'),
  requestId?: string(name='RequestId', description='The number of entries returned on each page.', example='CDABABABAB-FC28-4D9C-8FB5-68DC6F0486FC'),
  taskExecutions?: [ 
    {
      childExecutionId?: string(name='ChildExecutionId', description='The output of the execution.', example='exec-xxx'),
      createDate?: string(name='CreateDate', description='The ID of the execution.', example='2019-05-16T10:26:14Z'),
      endDate?: string(name='EndDate', description='The execution ID of the parent node.', example='2019-05-16T10:26:14Z'),
      executionId?: string(name='ExecutionId', description='The action of the task.', example='exec-44d32b45d2a449e49899'),
      extraData?: map[string]any(name='ExtraData', description='The Input parameters of the task execution.', example='{                     "NotifyNote":""                 }'),
      loop?: map[string]any(name='Loop', description='The ID of the template.', example='{}'),
      loopBatchNumber?: int32(name='LoopBatchNumber', description='The status information of the task execution.', example='2'),
      loopItem?: string(name='LoopItem', description='The time when the execution was created.', example='i-1234566zxcvvb'),
      outputs?: string(name='Outputs', description='The status of the task.', example='{ "InstanceId":"i-xxx" }'),
      parentTaskExecutionId?: string(name='ParentTaskExecutionId', description='The name of the task.', example='task-exec-xxx'),
      properties?: string(name='Properties', description='Queries task executions. Multiple methods are supported to filter task executions.', example='{ "Status":"Running" }'),
      startDate?: string(name='StartDate', description='The elements in the loop task.', example='2019-05-16T10:26:14Z'),
      status?: string(name='Status', description='The time when the task execution stopped running.', example='Running'),
      statusMessage?: string(name='StatusMessage', description='The additional information.', example='""'),
      taskAction?: string(name='TaskAction', description='The execution ID of the task.', example='ACS::Sleep'),
      taskExecutionId?: string(name='TaskExecutionId', description='The time when the execution was last updated.', example='task-exec-xxx'),
      taskName?: string(name='TaskName', description='The time when the execution started.', example='describeInstance'),
      templateId?: string(name='TemplateId', description='The number of times for which the loop task is run.', example='xxx'),
      updateDate?: string(name='UpdateDate', description='The configuration and statistics information of the loop task. This parameter is returned only for the parent node of the loop task.', example='2019-05-16T10:26:14Z'),
    }
  ](name='TaskExecutions', description='The execution ID of the child node.'),
}

model ListTaskExecutionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTaskExecutionsResponseBody(name='body'),
}

/**
 * @summary Queries task executions. Multiple methods are supported to filter task executions.
 *
 * @param request ListTaskExecutionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTaskExecutionsResponse
 */
async function listTaskExecutionsWithOptions(request: ListTaskExecutionsRequest, runtime: Util.RuntimeOptions): ListTaskExecutionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.endDateAfter)) {
    query['EndDateAfter'] = request.endDateAfter;
  }
  if (!Util.isUnset(request.endDateBefore)) {
    query['EndDateBefore'] = request.endDateBefore;
  }
  if (!Util.isUnset(request.executionId)) {
    query['ExecutionId'] = request.executionId;
  }
  if (!Util.isUnset(request.includeChildTaskExecution)) {
    query['IncludeChildTaskExecution'] = request.includeChildTaskExecution;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.parentTaskExecutionId)) {
    query['ParentTaskExecutionId'] = request.parentTaskExecutionId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.sortField)) {
    query['SortField'] = request.sortField;
  }
  if (!Util.isUnset(request.sortOrder)) {
    query['SortOrder'] = request.sortOrder;
  }
  if (!Util.isUnset(request.startDateAfter)) {
    query['StartDateAfter'] = request.startDateAfter;
  }
  if (!Util.isUnset(request.startDateBefore)) {
    query['StartDateBefore'] = request.startDateBefore;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.taskAction)) {
    query['TaskAction'] = request.taskAction;
  }
  if (!Util.isUnset(request.taskExecutionId)) {
    query['TaskExecutionId'] = request.taskExecutionId;
  }
  if (!Util.isUnset(request.taskName)) {
    query['TaskName'] = request.taskName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTaskExecutions',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries task executions. Multiple methods are supported to filter task executions.
 *
 * @param request ListTaskExecutionsRequest
 * @return ListTaskExecutionsResponse
 */
async function listTaskExecutions(request: ListTaskExecutionsRequest): ListTaskExecutionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTaskExecutionsWithOptions(request, runtime);
}

model ListTemplateVersionsRequest {
  maxResults?: int32(name='MaxResults', description='The number of entries per page. Valid values: 10 to 100', example='50'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results.', example='H8xj9c-398djs9-39ajd9asdjjJ'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  shareType?: string(name='ShareType', description='The type of the template. Valid values: Private and Public.', example='Private'),
  templateName?: string(name='TemplateName', description='The name of the template.

This parameter is required.', example='describeinstances'),
}

model ListTemplateVersionsResponseBody = {
  maxResults?: int32(name='MaxResults', description='The number of entries per page.', example='50'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results.', example='NJSNDKLJS-SJKJDO090k30-JSDK232'),
  requestId?: string(name='RequestId', description='The request ID.', example='E6CD612B-5889-4F1A-823F-8A4029E46'),
  templateVersions?: [ 
    {
      description?: string(name='Description', description='The description of the version.', example='Detach the eip from the special instance.'),
      templateFormat?: string(name='TemplateFormat', description='The format of the template content. Valid values: YAML and JSON.', example='YAML'),
      templateVersion?: string(name='TemplateVersion', description='The number of the version.', example='v2'),
      updatedBy?: string(name='UpdatedBy', description='The user who last updated the version.', example='foo'),
      updatedDate?: string(name='UpdatedDate', description='The time when the version was last updated.', example='2020-05-19T06:05:41Z'),
      versionName?: string(name='VersionName', description='The name of the version.', example='baz'),
    }
  ](name='TemplateVersions', description='The versions of the template.'),
}

model ListTemplateVersionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTemplateVersionsResponseBody(name='body'),
}

/**
 * @summary Queries a list of versions of a template.
 *
 * @param request ListTemplateVersionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTemplateVersionsResponse
 */
async function listTemplateVersionsWithOptions(request: ListTemplateVersionsRequest, runtime: Util.RuntimeOptions): ListTemplateVersionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.shareType)) {
    query['ShareType'] = request.shareType;
  }
  if (!Util.isUnset(request.templateName)) {
    query['TemplateName'] = request.templateName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTemplateVersions',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of versions of a template.
 *
 * @param request ListTemplateVersionsRequest
 * @return ListTemplateVersionsResponse
 */
async function listTemplateVersions(request: ListTemplateVersionsRequest): ListTemplateVersionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTemplateVersionsWithOptions(request, runtime);
}

model ListTemplatesRequest {
  category?: string(name='Category', description='The type of the template. Valid values include TimerTrigger, EventTrigger, AlarmTrigger, and Other.', example='TimerTrigger'),
  createdBy?: string(name='CreatedBy', description='The creator of the template.

*   To query the template provided by Alibaba Cloud, set this parameter to **ACS**.
*   To query the template created by a user, set this parameter to the **ID** of the template or the **name of the user** who creates the template.', example='ACS'),
  createdDateAfter?: string(name='CreatedDateAfter', description='Specifies to query the template that is created at or later than the specified time.

The value must be in the YYYY-MM-DDThh:mm:ssZ format.', example='2019-05-16T10:26:14Z'),
  createdDateBefore?: string(name='CreatedDateBefore', description='Specifies to query the template that is created at or before the specified time.

The value must be in the YYYY-MM-DDThh:mm::ssZ format.', example='2019-05-16T10:26:14Z'),
  hasTrigger?: boolean(name='HasTrigger', description='Specifies whether to query the template that is configured with a trigger.', example='true'),
  isExample?: boolean(name='IsExample', description='Specifies whether the template is an example template.', example='false'),
  isFavorite?: boolean(name='IsFavorite', description='Specifies whether the template is added to favorites.', example='true'),
  maxResults?: int32(name='MaxResults', description='The number of entries per page. Valid values: 10 to 100. Default value: 50.', example='50'),
  nextToken?: string(name='NextToken', description='The token that is used to retrieve the next page of results.', example='xxx'),
  regionId?: string(name='RegionId', description='The ID of the region in which you want to query templates.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
  shareType?: string(name='ShareType', description='The share type of the template. Valid values:

*   **Public**
*   **Private**', example='Private'),
  sortField?: string(name='SortField', description='The field that is used to sort the templates to be queried. Valid values:

*   **TotalExecutionCount** (default): The system sorts the returned templates based on the total number of times that the templates are used.
*   **Popularity**: The system sorts the returned templates based on the popularity of the templates.
*   **TemplateName**: The system sorts the returned templates based on the names of the templates.
*   **CreatedDate**: The system sorts the returned templates based on the points in time when the templates are created.
*   **UpdatedDate**: The system sorts the returned templates based on the points in time when the templates are updated.', example='Popularity'),
  sortOrder?: string(name='SortOrder', description='The order in which you want to sort the results. Valid values:

*   **Ascending**: ascending order.
*   **Descending**: descending order. This is the default value.', example='Descending'),
  tags?: map[string]any(name='Tags', description='The tag keys and values. The number of key-value pairs ranges from 1 to 20.', example='{"k1":"k2","k2":"v2"}'),
  templateFormat?: string(name='TemplateFormat', description='The format of the template. Valid values:

*   **JSON**
*   **YAML**', example='YAML'),
  templateName?: string(name='TemplateName', description='The name of the template. All templates whose names contain the specified template name are to be returned.', example='MyTemplate'),
  templateType?: string(name='TemplateType', description='The type of the template. Valid values:

*   Automation: the template for automated tasks.
*   State: the template for configuration inventories.
*   Package: the template for software packages.', example='private'),
}

model ListTemplatesShrinkRequest {
  category?: string(name='Category', description='The type of the template. Valid values include TimerTrigger, EventTrigger, AlarmTrigger, and Other.', example='TimerTrigger'),
  createdBy?: string(name='CreatedBy', description='The creator of the template.

*   To query the template provided by Alibaba Cloud, set this parameter to **ACS**.
*   To query the template created by a user, set this parameter to the **ID** of the template or the **name of the user** who creates the template.', example='ACS'),
  createdDateAfter?: string(name='CreatedDateAfter', description='Specifies to query the template that is created at or later than the specified time.

The value must be in the YYYY-MM-DDThh:mm:ssZ format.', example='2019-05-16T10:26:14Z'),
  createdDateBefore?: string(name='CreatedDateBefore', description='Specifies to query the template that is created at or before the specified time.

The value must be in the YYYY-MM-DDThh:mm::ssZ format.', example='2019-05-16T10:26:14Z'),
  hasTrigger?: boolean(name='HasTrigger', description='Specifies whether to query the template that is configured with a trigger.', example='true'),
  isExample?: boolean(name='IsExample', description='Specifies whether the template is an example template.', example='false'),
  isFavorite?: boolean(name='IsFavorite', description='Specifies whether the template is added to favorites.', example='true'),
  maxResults?: int32(name='MaxResults', description='The number of entries per page. Valid values: 10 to 100. Default value: 50.', example='50'),
  nextToken?: string(name='NextToken', description='The token that is used to retrieve the next page of results.', example='xxx'),
  regionId?: string(name='RegionId', description='The ID of the region in which you want to query templates.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
  shareType?: string(name='ShareType', description='The share type of the template. Valid values:

*   **Public**
*   **Private**', example='Private'),
  sortField?: string(name='SortField', description='The field that is used to sort the templates to be queried. Valid values:

*   **TotalExecutionCount** (default): The system sorts the returned templates based on the total number of times that the templates are used.
*   **Popularity**: The system sorts the returned templates based on the popularity of the templates.
*   **TemplateName**: The system sorts the returned templates based on the names of the templates.
*   **CreatedDate**: The system sorts the returned templates based on the points in time when the templates are created.
*   **UpdatedDate**: The system sorts the returned templates based on the points in time when the templates are updated.', example='Popularity'),
  sortOrder?: string(name='SortOrder', description='The order in which you want to sort the results. Valid values:

*   **Ascending**: ascending order.
*   **Descending**: descending order. This is the default value.', example='Descending'),
  tagsShrink?: string(name='Tags', description='The tag keys and values. The number of key-value pairs ranges from 1 to 20.', example='{"k1":"k2","k2":"v2"}'),
  templateFormat?: string(name='TemplateFormat', description='The format of the template. Valid values:

*   **JSON**
*   **YAML**', example='YAML'),
  templateName?: string(name='TemplateName', description='The name of the template. All templates whose names contain the specified template name are to be returned.', example='MyTemplate'),
  templateType?: string(name='TemplateType', description='The type of the template. Valid values:

*   Automation: the template for automated tasks.
*   State: the template for configuration inventories.
*   Package: the template for software packages.', example='private'),
}

model ListTemplatesResponseBody = {
  maxResults?: int32(name='MaxResults', description='The number of entries returned on each page.', example='50'),
  nextToken?: string(name='NextToken', description='The token that is used to retrieve the next page of results.', example='xxx'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='BEF54BA-17B6-449F-A219-49ACB157E3'),
  templates?: [ 
    {
      category?: string(name='Category', description='The template type.', example='TimerTrigger'),
      constraints?: string(name='Constraints', description='The template constraints.', example='{
  "InstanceTypeFamilies": ["ecs.g8y", "ecs.c8y"],
  "ImageTypes": ["system"],
  "OSPlatforms": ["CentOS", "Ubuntu"],
  "OSVersions": ["CentOS7.9 64bit"]
}'),
      createdBy?: string(name='CreatedBy', description='The user who created the template.', example='root(1309200)'),
      createdDate?: string(name='CreatedDate', description='The creation time of the template.', example='2019-05-16T10:26:14Z'),
      description?: string(name='Description', description='The template description.', example='Describe instances of given status'),
      hasTrigger?: boolean(name='HasTrigger', description='Indicates whether the template was configured with a trigger.', example='true'),
      hash?: string(name='Hash', description='The SHA256 value of the template content.', example='4bc7d7a21b3e003434b9c223f6e6d2578b5ebfeb5be28c1fcf8a8a1b11907bb4'),
      isFavorite?: boolean(name='IsFavorite', description='Indicates whether the template is added to favorites.', example='true'),
      popularity?: int32(name='Popularity', description='The popularity of the public template. Valid values: **1-10**. A greater value indicates higher popularity. If **ShareType** is set to **Private**, the value of this parameter is `-1`.

>  This parameter is valid only if **ShareType** is set to **Public**.', example='8'),
      publisher?: string(name='Publisher', description='The user who published the template.', example='aliyun'),
      resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
      shareType?: string(name='ShareType', description='The share type of the template. The share type of a template created by a user is **Private**. Valid values:

*   **Public**
*   **Private**', example='Public'),
      tags?: map[string]any(name='Tags', description='The tag keys and values. The number of key-value pairs ranges from 1 to 20.', example='{"k1":"v1","k2":"v2"}'),
      templateFormat?: string(name='TemplateFormat', description='The template format. The system automatically determines whether the format of the template is JSON or YAML.', example='JSON'),
      templateId?: string(name='TemplateId', description='The template ID.', example='t-94753deed38'),
      templateName?: string(name='TemplateName', description='The template name.', example='MyTemplate'),
      templateType?: string(name='TemplateType', description='The template type.', example='private'),
      templateVersion?: string(name='TemplateVersion', description='The template version. The version contains the letter v and a number. The number starts from 1.', example='v1'),
      totalExecutionCount?: int32(name='TotalExecutionCount', description='The number of times for which the private template is executed. If **ShareType** is set to **Public**, the value of this parameter is `-1`.

>  This parameter is valid only if **ShareType** is set to **Private**.', example='5'),
      updatedBy?: string(name='UpdatedBy', description='The user who last updated the template.', example='root(13092000)'),
      updatedDate?: string(name='UpdatedDate', description='The time when the template was last updated.', example='2019-05-16T10:26:14Z'),
      versionName?: string(name='VersionName', description='The version name.', example='v2.1'),
    }
  ](name='Templates', description='The template metadata.'),
}

model ListTemplatesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTemplatesResponseBody(name='body'),
}

/**
 * @summary Queries templates. Multiple methods are supported to filter templates.
 *
 * @param tmpReq ListTemplatesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTemplatesResponse
 */
async function listTemplatesWithOptions(tmpReq: ListTemplatesRequest, runtime: Util.RuntimeOptions): ListTemplatesResponse {
  Util.validateModel(tmpReq);
  var request = new ListTemplatesShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.tags)) {
    request.tagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tags, 'Tags', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.category)) {
    query['Category'] = request.category;
  }
  if (!Util.isUnset(request.createdBy)) {
    query['CreatedBy'] = request.createdBy;
  }
  if (!Util.isUnset(request.createdDateAfter)) {
    query['CreatedDateAfter'] = request.createdDateAfter;
  }
  if (!Util.isUnset(request.createdDateBefore)) {
    query['CreatedDateBefore'] = request.createdDateBefore;
  }
  if (!Util.isUnset(request.hasTrigger)) {
    query['HasTrigger'] = request.hasTrigger;
  }
  if (!Util.isUnset(request.isExample)) {
    query['IsExample'] = request.isExample;
  }
  if (!Util.isUnset(request.isFavorite)) {
    query['IsFavorite'] = request.isFavorite;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.shareType)) {
    query['ShareType'] = request.shareType;
  }
  if (!Util.isUnset(request.sortField)) {
    query['SortField'] = request.sortField;
  }
  if (!Util.isUnset(request.sortOrder)) {
    query['SortOrder'] = request.sortOrder;
  }
  if (!Util.isUnset(request.tagsShrink)) {
    query['Tags'] = request.tagsShrink;
  }
  if (!Util.isUnset(request.templateFormat)) {
    query['TemplateFormat'] = request.templateFormat;
  }
  if (!Util.isUnset(request.templateName)) {
    query['TemplateName'] = request.templateName;
  }
  if (!Util.isUnset(request.templateType)) {
    query['TemplateType'] = request.templateType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTemplates',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries templates. Multiple methods are supported to filter templates.
 *
 * @param request ListTemplatesRequest
 * @return ListTemplatesResponse
 */
async function listTemplates(request: ListTemplatesRequest): ListTemplatesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTemplatesWithOptions(request, runtime);
}

model NotifyExecutionRequest {
  executionId?: string(name='ExecutionId', description='The ID of the execution.

This parameter is required.', example='exec-xxx'),
  executionStatus?: string(name='ExecutionStatus', description='The state of the terminated execution. This parameter is valid if you set the NotifyType parameter to CompleteExecution.', example='Success'),
  loopItem?: string(name='LoopItem', description='The items of the child node in the loop task.', example='i-xxx'),
  notifyNote?: string(name='NotifyNote', description='The description for the notification.', example='Note'),
  notifyType?: string(name='NotifyType', description='The type of the notification. Valid values:

*   **ExecuteTask**: starts to run a specific task. This value is used if you perform debugging in the Debug mode. If you set this parameter to ExecuteTask, you also need to set the Parameters parameter.
*   **CancelTask**: cancels a current task. This value is used if you perform debugging in the Debug mode.
*   **CompleteExecution**: manually terminates an execution if you perform debugging in the Debug mode. You can specify the state of the terminated execution by using the **ExecutionStatus** parameter.
*   **Approve**: approves an execution. For example, you are aware of the risks of an operation task and agree to approve the execution.
*   **Reject**: rejects an execution. For example, you want to reject the execution of a high-risk operation task.
*   **RetryTask**: retries a failed task whose execution mode is Suspend upon Failure.
*   **SkipTask**: skips a failed task whose execution mode is Suspend upon Failure.

This parameter is required.', example='Approve'),
  parameters?: string(name='Parameters', description='The parameters of the subsequent task. This parameter is valid if you set the NotifyType parameter to ExecuteTask.', example='{}'),
  regionId?: string(name='RegionId', description='The ID of the region in which the execution resides.', example='cn-hangzhou'),
  taskExecutionId?: string(name='TaskExecutionId', description='The execution ID of the task.', example='task-exec-xxx'),
  taskExecutionIds?: string(name='TaskExecutionIds', description='The execution IDs of the tasks.', example='["exec-79c321c11003a97c","exec-79c321c11003aqw97cz"]'),
  taskName?: string(name='TaskName', description='The name of the subsequent task.', example='describeInstance'),
}

model NotifyExecutionResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='491DF8C2-34C9-4679-9DB3-4C0F49B129AC'),
}

model NotifyExecutionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: NotifyExecutionResponseBody(name='body'),
}

/**
 * @summary Notifies an execution in the Waiting state of the subsequent operations.
 *
 * @description You can call this operation to notify an execution in the following scenarios:
 * *   If a template contains a special task, such as an approval task, the Operation Orchestration Service (OOS) execution engine sets the execution state to Waiting when the approval task is being run. You can call this operation to specify whether to continue the execution.
 * *   If you perform debugging in the debug mode, you can call this operation to notify the execution of the subsequent operations after the execution is created or a task is complete.
 * *   If a high-risk operation task waits for approval, you can call this operation to specify whether to continue the execution.
 *
 * @param request NotifyExecutionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return NotifyExecutionResponse
 */
async function notifyExecutionWithOptions(request: NotifyExecutionRequest, runtime: Util.RuntimeOptions): NotifyExecutionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.executionId)) {
    query['ExecutionId'] = request.executionId;
  }
  if (!Util.isUnset(request.executionStatus)) {
    query['ExecutionStatus'] = request.executionStatus;
  }
  if (!Util.isUnset(request.loopItem)) {
    query['LoopItem'] = request.loopItem;
  }
  if (!Util.isUnset(request.notifyNote)) {
    query['NotifyNote'] = request.notifyNote;
  }
  if (!Util.isUnset(request.notifyType)) {
    query['NotifyType'] = request.notifyType;
  }
  if (!Util.isUnset(request.parameters)) {
    query['Parameters'] = request.parameters;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.taskExecutionId)) {
    query['TaskExecutionId'] = request.taskExecutionId;
  }
  if (!Util.isUnset(request.taskExecutionIds)) {
    query['TaskExecutionIds'] = request.taskExecutionIds;
  }
  if (!Util.isUnset(request.taskName)) {
    query['TaskName'] = request.taskName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'NotifyExecution',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Notifies an execution in the Waiting state of the subsequent operations.
 *
 * @description You can call this operation to notify an execution in the following scenarios:
 * *   If a template contains a special task, such as an approval task, the Operation Orchestration Service (OOS) execution engine sets the execution state to Waiting when the approval task is being run. You can call this operation to specify whether to continue the execution.
 * *   If you perform debugging in the debug mode, you can call this operation to notify the execution of the subsequent operations after the execution is created or a task is complete.
 * *   If a high-risk operation task waits for approval, you can call this operation to specify whether to continue the execution.
 *
 * @param request NotifyExecutionRequest
 * @return NotifyExecutionResponse
 */
async function notifyExecution(request: NotifyExecutionRequest): NotifyExecutionResponse {
  var runtime = new Util.RuntimeOptions{};
  return notifyExecutionWithOptions(request, runtime);
}

model RegisterDefaultPatchBaselineRequest {
  name?: string(name='Name', description='The name of the patch baseline.

This parameter is required.', example='MyPatchBaseline'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
}

model RegisterDefaultPatchBaselineResponseBody = {
  patchBaseline?: {
    approvalRules?: string(name='ApprovalRules', description='The rules of scanning and installing patches for the specified operating system.', example='{"PatchRules":[{"PatchFilterGroup":[{"Key":"PatchSet","Values":["OS"]},{"Key":"ProductFamily","Values":["Windows"]},{"Key":"Product","Values":["Windows 10","Windows 7"]},{"Key":"Classification","Values":["Security Updates","Updates","Update Rollups","Critical Updates"]},{"Key":"Severity","Values":["Critical","Important","Moderate"]}],"ApproveAfterDays":7,"ApproveUntilDate":"","EnableNonSecurity":true,"ComplianceLevel":"Medium"}]}'),
    createdBy?: string(name='CreatedBy', description='The user who created the patch baseline.', example='root(130900000)'),
    createdDate?: string(name='CreatedDate', description='The time when the patch baseline was created.', example='2021-09-07T03:42:56Z'),
    description?: string(name='Description', description='The description of the patch baseline.', example='RegisterPatchBaseline'),
    id?: string(name='Id', description='The ID of the patch baseline.', example='pb-445340b5c6504a85a300'),
    name?: string(name='Name', description='The name of the patch baseline.', example='MyPatchBaseline'),
    operationSystem?: string(name='OperationSystem', description='The operating system.', example='Windows'),
    resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfm4dpaq2yox6q'),
    shareType?: string(name='ShareType', description='The share type of the patch baseline.', example='Private'),
    updatedBy?: string(name='UpdatedBy', description='The user who last updated the patch baseline.', example='root(130900000)'),
    updatedDate?: string(name='UpdatedDate', description='The time when the patch baseline was last updated.', example='2021-09-07T03:42:56Z'),
  }(name='PatchBaseline', description='The details of the patch baseline.'),
  requestId?: string(name='RequestId', description='The request ID.', example='D6850689-348D-59FC-AE13-BB0EDB7C4BE8'),
}

model RegisterDefaultPatchBaselineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RegisterDefaultPatchBaselineResponseBody(name='body'),
}

/**
 * @summary Registers the default patch baseline.
 *
 * @param request RegisterDefaultPatchBaselineRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RegisterDefaultPatchBaselineResponse
 */
async function registerDefaultPatchBaselineWithOptions(request: RegisterDefaultPatchBaselineRequest, runtime: Util.RuntimeOptions): RegisterDefaultPatchBaselineResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RegisterDefaultPatchBaseline',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Registers the default patch baseline.
 *
 * @param request RegisterDefaultPatchBaselineRequest
 * @return RegisterDefaultPatchBaselineResponse
 */
async function registerDefaultPatchBaseline(request: RegisterDefaultPatchBaselineRequest): RegisterDefaultPatchBaselineResponse {
  var runtime = new Util.RuntimeOptions{};
  return registerDefaultPatchBaselineWithOptions(request, runtime);
}

model SearchInventoryRequest {
  aggregator?: [ string ](name='Aggregator', description='The information about aggregators. You can use one or more aggregators to query the aggregate information of an instance. Valid values:

*   ACS:Application.Name
*   ACS:Application.Version', example='ACS:Application.Name'),
  filter?: [ 
    {
      name?: string(name='Name', description='The name of the component property. Valid values of N: 1 to 5. Different components have different property names. You can call the [GetInventorySchema](https://api.aliyun.com/#/?product=oos\\\\&version=2019-06-01\\\\&api=GetInventorySchema) operation to query the property names of different components. For example, the ACS:InstanceInformation component has the InstanceId property. Therefore, you can set this parameter to ACS:InstanceInformation.InstanceId.', example='ACS:InstanceInformation.InstanceId'),
      operator?: string(name='Operator', description='The comparison operator that is used to filter property values. Valid values of N: 1 to 5. Valid values:

*   Equal
*   NotEqual
*   BeginWith
*   LessThan
*   GreaterThan', example='Equal'),
      value?: [ string ](name='Value', description='The property values to query.', example='i-bp1cpoxxxxxxxxxxxxxx'),
    }
  ](name='Filter', description='The filter rules for the component.'),
  maxResults?: int32(name='MaxResults', description='The number of entries per page. Valid values: 1 to 100. Default value: 50.', example='50'),
  nextToken?: string(name='NextToken', description='The token that is used to retrieve the next page of results.', example='gAAAAABfTgv5ewUWmNdJ3g7JVLvX70sPH90GZOVGC'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
}

model SearchInventoryResponseBody = {
  entities?: [  map[string]any ](name='Entities'),
  maxResults?: int32(name='MaxResults', description='The number of entries returned per page.', example='50'),
  nextToken?: string(name='NextToken', description='The token that is used to retrieve the next page of results.', example='gAAAAABfTgv5ewUWmNdJ3g7JVLvX70sPH90GZOVGC'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='A81E4B2E-6B33-4BAE-9856-55DB7C893E01'),
}

model SearchInventoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SearchInventoryResponseBody(name='body'),
}

/**
 * @summary Queries the details or aggregate information of a configuration inventory.
 *
 * @param request SearchInventoryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SearchInventoryResponse
 */
async function searchInventoryWithOptions(request: SearchInventoryRequest, runtime: Util.RuntimeOptions): SearchInventoryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aggregator)) {
    query['Aggregator'] = request.aggregator;
  }
  if (!Util.isUnset(request.filter)) {
    query['Filter'] = request.filter;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SearchInventory',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details or aggregate information of a configuration inventory.
 *
 * @param request SearchInventoryRequest
 * @return SearchInventoryResponse
 */
async function searchInventory(request: SearchInventoryRequest): SearchInventoryResponse {
  var runtime = new Util.RuntimeOptions{};
  return searchInventoryWithOptions(request, runtime);
}

model SetServiceSettingsRequest {
  deliveryOssBucketName?: string(name='DeliveryOssBucketName', description='The name of OSS bucket to deliver.', example='OssBucketName'),
  deliveryOssEnabled?: boolean(name='DeliveryOssEnabled', description='Whether to enable OSS delivery.', example='false'),
  deliveryOssKeyPrefix?: string(name='DeliveryOssKeyPrefix', description='The key prefix of OSS to deliver.', example='oos/execution'),
  deliverySlsEnabled?: boolean(name='DeliverySlsEnabled', description='Whether to enable SLS delivery.', example='false'),
  deliverySlsProjectName?: string(name='DeliverySlsProjectName', description='The name of SLS project to deliver.', example='SlsProjectName'),
  rdcEnterpriseId?: string(name='RdcEnterpriseId', description='The id of RDC Enterprise.', example='RdcEnterpriseId'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
}

model SetServiceSettingsResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='CBEC8072-BEC2-478E-8EAE-E723BA79CF19'),
  serviceSettings?: [ 
    {
      deliveryOssBucketName?: string(name='DeliveryOssBucketName', description='The name of OSS bucket to deliver.', example='OssBucketName'),
      deliveryOssEnabled?: boolean(name='DeliveryOssEnabled', description='Whether to enable OSS delivery.', example='true'),
      deliveryOssKeyPrefix?: string(name='DeliveryOssKeyPrefix', description='The key prefix of OSS to deliver.', example='oos/execution'),
      deliverySlsEnabled?: boolean(name='DeliverySlsEnabled', description='Whether to enable SLS delivery.', example='false'),
      deliverySlsProjectName?: string(name='DeliverySlsProjectName', description='The name of SLS project to deliver.', example='SlsProjectName'),
      rdcEnterpriseId?: string(name='RdcEnterpriseId', description='The id of RDC Enterprise.', example='RdcEnterpriseId'),
    }
  ](name='ServiceSettings', description='The information of service settings.'),
}

model SetServiceSettingsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetServiceSettingsResponseBody(name='body'),
}

/**
 * @summary Enables or disables the feature of delivering template execution records and sets the storage location.
 *
 * @param request SetServiceSettingsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SetServiceSettingsResponse
 */
async function setServiceSettingsWithOptions(request: SetServiceSettingsRequest, runtime: Util.RuntimeOptions): SetServiceSettingsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deliveryOssBucketName)) {
    query['DeliveryOssBucketName'] = request.deliveryOssBucketName;
  }
  if (!Util.isUnset(request.deliveryOssEnabled)) {
    query['DeliveryOssEnabled'] = request.deliveryOssEnabled;
  }
  if (!Util.isUnset(request.deliveryOssKeyPrefix)) {
    query['DeliveryOssKeyPrefix'] = request.deliveryOssKeyPrefix;
  }
  if (!Util.isUnset(request.deliverySlsEnabled)) {
    query['DeliverySlsEnabled'] = request.deliverySlsEnabled;
  }
  if (!Util.isUnset(request.deliverySlsProjectName)) {
    query['DeliverySlsProjectName'] = request.deliverySlsProjectName;
  }
  if (!Util.isUnset(request.rdcEnterpriseId)) {
    query['RdcEnterpriseId'] = request.rdcEnterpriseId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetServiceSettings',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Enables or disables the feature of delivering template execution records and sets the storage location.
 *
 * @param request SetServiceSettingsRequest
 * @return SetServiceSettingsResponse
 */
async function setServiceSettings(request: SetServiceSettingsRequest): SetServiceSettingsResponse {
  var runtime = new Util.RuntimeOptions{};
  return setServiceSettingsWithOptions(request, runtime);
}

model StartExecutionRequest {
  clientToken?: string(name='ClientToken', description='The access token.', example='123e56767-e89b-12d3-a456-426655440000'),
  description?: string(name='Description', description='The description of the execution.', example='test execution.'),
  loopMode?: string(name='LoopMode', description='The loop mode. Valid values:

*   Automatic: does not suspend the execution of the template. This is the default value.
*   FirstBatchPause: suspends the execution of the template after the first batch is complete.
*   EveryBatchPause: suspends the execution of the template after each batch is complete.', example='Automatic'),
  mode?: string(name='Mode', description='The execution mode. Valid values:

*   Automatic: automatically starts the execution of the template. This is the default value.
*   FailurePause: suspends the execution of the template upon a failure.
*   Debug: manually starts the execution of the template.', example='Automatic'),
  parameters?: string(name='Parameters', description='The JSON string that consists of a set of parameters. Default value: {}.', example='{"Status":"Running"}'),
  parentExecutionId?: string(name='ParentExecutionId', description='The ID of the parent execution.', example='exec-xxx'),
  regionId?: string(name='RegionId', description='The ID of the region in which the execution resides.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
  safetyCheck?: string(name='SafetyCheck', description='The security check mode. Valid values:

*   Skip: specifies that you are aware of the risks. The system performs all actions in the execution without manual confirmation, regardless of the risk level. This parameter is valid only if the `Mode` parameter is set to Automatic.
*   ConfirmEveryHighRiskAction: requires you to confirm each high-risk action. This is the default value. You can call the **NotifyExecution** operation to confirm or cancel an action.', example='Skip'),
  tags?: map[string]any(name='Tags', description='The tags for the execution.', example='{"k1":"v2","k2":"v2"}'),
  templateContent?: string(name='TemplateContent', description='The content of the template in the JSON or YAML format. This parameter is the same as the Content parameter that you can specify when you call the CreateTemplate operation. You can use this parameter to specify the tasks that you want to run. This way, you do not need to create a template before you start an execution. If you select an existing template, you do not need to specify this parameter.', example='{   "Description": "Example template, describe instances in some status",   "FormatVersion": "OOS-2019-06-01",   "Parameters": {},   "Tasks": [     {       "Name": "describeInstances",       "Action": "ACS::ExecuteAPI",       "Description": "desc-en",       "Properties": {         "Service": "ECS",         "API": "DescribeInstances",         "Parameters": {           "Status": "Running"         }       }     }   ] }'),
  templateName?: string(name='TemplateName', description='The name of the template. The name must be 1 to 200 characters in length, and can contain letters, digits, hyphens (-), and underscores (_).', example='vmeixme'),
  templateURL?: string(name='TemplateURL', description='The Object Storage Service (OSS) URL of the object that stores the content of the Operation Orchestration Service (OOS) template. The access control list (ACL) of the object must be public-read. You can use this parameter to specify the tasks that you want to run. This way, you do not need to create a template before you start an execution. If you select an existing template, you do not need to specify this parameter.', example='http://oos-template.cn-hangzhou.oss.aliyun-inc.com/oos-test-template.json'),
  templateVersion?: string(name='TemplateVersion', description='The version number of the template. If you do not specify this parameter, the system uses the latest version.', example='v1'),
}

model StartExecutionShrinkRequest {
  clientToken?: string(name='ClientToken', description='The access token.', example='123e56767-e89b-12d3-a456-426655440000'),
  description?: string(name='Description', description='The description of the execution.', example='test execution.'),
  loopMode?: string(name='LoopMode', description='The loop mode. Valid values:

*   Automatic: does not suspend the execution of the template. This is the default value.
*   FirstBatchPause: suspends the execution of the template after the first batch is complete.
*   EveryBatchPause: suspends the execution of the template after each batch is complete.', example='Automatic'),
  mode?: string(name='Mode', description='The execution mode. Valid values:

*   Automatic: automatically starts the execution of the template. This is the default value.
*   FailurePause: suspends the execution of the template upon a failure.
*   Debug: manually starts the execution of the template.', example='Automatic'),
  parameters?: string(name='Parameters', description='The JSON string that consists of a set of parameters. Default value: {}.', example='{"Status":"Running"}'),
  parentExecutionId?: string(name='ParentExecutionId', description='The ID of the parent execution.', example='exec-xxx'),
  regionId?: string(name='RegionId', description='The ID of the region in which the execution resides.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
  safetyCheck?: string(name='SafetyCheck', description='The security check mode. Valid values:

*   Skip: specifies that you are aware of the risks. The system performs all actions in the execution without manual confirmation, regardless of the risk level. This parameter is valid only if the `Mode` parameter is set to Automatic.
*   ConfirmEveryHighRiskAction: requires you to confirm each high-risk action. This is the default value. You can call the **NotifyExecution** operation to confirm or cancel an action.', example='Skip'),
  tagsShrink?: string(name='Tags', description='The tags for the execution.', example='{"k1":"v2","k2":"v2"}'),
  templateContent?: string(name='TemplateContent', description='The content of the template in the JSON or YAML format. This parameter is the same as the Content parameter that you can specify when you call the CreateTemplate operation. You can use this parameter to specify the tasks that you want to run. This way, you do not need to create a template before you start an execution. If you select an existing template, you do not need to specify this parameter.', example='{   "Description": "Example template, describe instances in some status",   "FormatVersion": "OOS-2019-06-01",   "Parameters": {},   "Tasks": [     {       "Name": "describeInstances",       "Action": "ACS::ExecuteAPI",       "Description": "desc-en",       "Properties": {         "Service": "ECS",         "API": "DescribeInstances",         "Parameters": {           "Status": "Running"         }       }     }   ] }'),
  templateName?: string(name='TemplateName', description='The name of the template. The name must be 1 to 200 characters in length, and can contain letters, digits, hyphens (-), and underscores (_).', example='vmeixme'),
  templateURL?: string(name='TemplateURL', description='The Object Storage Service (OSS) URL of the object that stores the content of the Operation Orchestration Service (OOS) template. The access control list (ACL) of the object must be public-read. You can use this parameter to specify the tasks that you want to run. This way, you do not need to create a template before you start an execution. If you select an existing template, you do not need to specify this parameter.', example='http://oos-template.cn-hangzhou.oss.aliyun-inc.com/oos-test-template.json'),
  templateVersion?: string(name='TemplateVersion', description='The version number of the template. If you do not specify this parameter, the system uses the latest version.', example='v1'),
}

model StartExecutionResponseBody = {
  execution?: {
    counters?: map[string]any(name='Counters', description='The number of executions.', example='1'),
    createDate?: string(name='CreateDate', description='The time when the execution was created.', example='2019-05-16T10:26:14Z'),
    currentTasks?: [ 
      {
        taskAction?: string(name='TaskAction', description='The action of the task.', example='ACS::TimerTrigger'),
        taskExecutionId?: string(name='TaskExecutionId', description='The execution ID of the task.', example='exec-dsadasdawq'),
        taskName?: string(name='TaskName', description='The name of the task.', example='testTask'),
      }
    ](name='CurrentTasks', description='The information about in-progress tasks.'),
    description?: string(name='Description', description='The description of the execution.', example='test execution.'),
    endDate?: string(name='EndDate', description='The time when the execution stopped.', example='2019-05-16T10:26:14Z'),
    executedBy?: string(name='ExecutedBy', description='The account ID of the user who started the execution of the template.', example='root(13092080xx12344)'),
    executionId?: string(name='ExecutionId', description='The GUID of the execution.', example='exec-xxxyyy'),
    isParent?: boolean(name='IsParent', description='Indicates whether the execution is a parent execution.', example='false'),
    loopMode?: string(name='LoopMode', description='The loop mode.', example='Automatic'),
    mode?: string(name='Mode', description='The execution mode.', example='Automatic'),
    outputs?: string(name='Outputs', description='The output of the execution.', example='{ "InstanceId":"i-xxx" }'),
    parameters?: string(name='Parameters', description='The input parameters of the execution.', example='{ "Status":"Running" }'),
    parentExecutionId?: string(name='ParentExecutionId', description='The ID of the parent execution.', example='exec-xxxx'),
    ramRole?: string(name='RamRole', description='The role that started the execution of the template.', example='OOSServiceRole'),
    resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
    safetyCheck?: string(name='SafetyCheck', description='The security check mode.', example='Skip'),
    startDate?: string(name='StartDate', description='The time when the execution was started.', example='2019-05-16T10:26:14Z'),
    status?: string(name='Status', description='The status of the execution.', example='Success'),
    statusMessage?: string(name='StatusMessage', description='The status information of the execution.', example='""'),
    tags?: map[string]any(name='Tags', description='The tags of the execution.', example='{"k1":"v2","k2":"v2"}'),
    templateId?: string(name='TemplateId', description='The ID of the template.', example='t-1bd341007f'),
    templateName?: string(name='TemplateName', description='The name of the template.', example='MyTemplate'),
    templateVersion?: string(name='TemplateVersion', description='The version number of the template.', example='v1'),
    updateDate?: string(name='UpdateDate', description='The time when the execution was last updated.', example='2019-05-16T10:26:14Z'),
  }(name='Execution', description='The details of the execution.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='14A07460-EBE7-47CA-9757-12CC4761D47A'),
}

model StartExecutionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartExecutionResponseBody(name='body'),
}

/**
 * @summary Starts an execution.
 *
 * @param tmpReq StartExecutionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartExecutionResponse
 */
async function startExecutionWithOptions(tmpReq: StartExecutionRequest, runtime: Util.RuntimeOptions): StartExecutionResponse {
  Util.validateModel(tmpReq);
  var request = new StartExecutionShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.tags)) {
    request.tagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tags, 'Tags', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.loopMode)) {
    query['LoopMode'] = request.loopMode;
  }
  if (!Util.isUnset(request.mode)) {
    query['Mode'] = request.mode;
  }
  if (!Util.isUnset(request.parameters)) {
    query['Parameters'] = request.parameters;
  }
  if (!Util.isUnset(request.parentExecutionId)) {
    query['ParentExecutionId'] = request.parentExecutionId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.safetyCheck)) {
    query['SafetyCheck'] = request.safetyCheck;
  }
  if (!Util.isUnset(request.tagsShrink)) {
    query['Tags'] = request.tagsShrink;
  }
  if (!Util.isUnset(request.templateContent)) {
    query['TemplateContent'] = request.templateContent;
  }
  if (!Util.isUnset(request.templateName)) {
    query['TemplateName'] = request.templateName;
  }
  if (!Util.isUnset(request.templateURL)) {
    query['TemplateURL'] = request.templateURL;
  }
  if (!Util.isUnset(request.templateVersion)) {
    query['TemplateVersion'] = request.templateVersion;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StartExecution',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Starts an execution.
 *
 * @param request StartExecutionRequest
 * @return StartExecutionResponse
 */
async function startExecution(request: StartExecutionRequest): StartExecutionResponse {
  var runtime = new Util.RuntimeOptions{};
  return startExecutionWithOptions(request, runtime);
}

model TagResourcesRequest {
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  resourceIds?: map[string]any(name='ResourceIds', description='The IDs of the resources for which you want to modify the resource group. The number of resource IDs is 1 to 50.

*   If you set ResourceType to template, specify ResourceIds in the ["TemplateName1","TemplateName2"] format.
*   If you set ResourceType to parameter, specify ResourceIds in the ["Name1","Name2"] format.
*   If you set ResourceType to secretparameter, specify ResourceIds in the ["Name1","Name2"] format.
*   If you set ResourceType to stateconfiguration, specify ResourceIds in the ["StateConfigurationId 1","StateConfigurationId 2"] format.
*   If you set ResourceType to application, specify ResourceIds in the ["Name1","Name2"] format.

This parameter is required.', example='["templateName1","templateName2"]'),
  resourceType?: string(name='ResourceType', description='The type of the resource for which you want to modify the resource group. Valid values:

*   template: template.
*   parameter: parameter.
*   secretparameter: encryption parameter.
*   stateconfiguration: desired-state configuration.
*   application: application.

This parameter is required.', example='template'),
  tags?: map[string]any(name='Tags', description='The tag keys and values. The number of key-value pairs ranges from 1 to 20.

This parameter is required.', example='{"k1":"v1","k2":"v2"}'),
}

model TagResourcesShrinkRequest {
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  resourceIdsShrink?: string(name='ResourceIds', description='The IDs of the resources for which you want to modify the resource group. The number of resource IDs is 1 to 50.

*   If you set ResourceType to template, specify ResourceIds in the ["TemplateName1","TemplateName2"] format.
*   If you set ResourceType to parameter, specify ResourceIds in the ["Name1","Name2"] format.
*   If you set ResourceType to secretparameter, specify ResourceIds in the ["Name1","Name2"] format.
*   If you set ResourceType to stateconfiguration, specify ResourceIds in the ["StateConfigurationId 1","StateConfigurationId 2"] format.
*   If you set ResourceType to application, specify ResourceIds in the ["Name1","Name2"] format.

This parameter is required.', example='["templateName1","templateName2"]'),
  resourceType?: string(name='ResourceType', description='The type of the resource for which you want to modify the resource group. Valid values:

*   template: template.
*   parameter: parameter.
*   secretparameter: encryption parameter.
*   stateconfiguration: desired-state configuration.
*   application: application.

This parameter is required.', example='template'),
  tagsShrink?: string(name='Tags', description='The tag keys and values. The number of key-value pairs ranges from 1 to 20.

This parameter is required.', example='{"k1":"v1","k2":"v2"}'),
}

model TagResourcesResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='B19AE203-FD99-49C7-9253-FAAACAD46F4A'),
}

model TagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TagResourcesResponseBody(name='body'),
}

/**
 * @summary Adds tags to one or more resources.
 *
 * @param tmpReq TagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return TagResourcesResponse
 */
async function tagResourcesWithOptions(tmpReq: TagResourcesRequest, runtime: Util.RuntimeOptions): TagResourcesResponse {
  Util.validateModel(tmpReq);
  var request = new TagResourcesShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.resourceIds)) {
    request.resourceIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.resourceIds, 'ResourceIds', 'json');
  }
  if (!Util.isUnset(tmpReq.tags)) {
    request.tagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tags, 'Tags', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceIdsShrink)) {
    query['ResourceIds'] = request.resourceIdsShrink;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.tagsShrink)) {
    query['Tags'] = request.tagsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'TagResources',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Adds tags to one or more resources.
 *
 * @param request TagResourcesRequest
 * @return TagResourcesResponse
 */
async function tagResources(request: TagResourcesRequest): TagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return tagResourcesWithOptions(request, runtime);
}

model TriggerExecutionRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.', example='dswe2-3i0-029'),
  content?: string(name='Content', description='The message body to be sent to the trigger task.', example='{"eventTime": "20181226T220114.058+0800", "id": "9435EAD6-3CF6-4494-8F7A-3A********77","level": "INFO","name": "Instance:StateChange","product": "ECS","regionId":"cn-hangzhou","resourceId": "acs:ecs:cn-hangzhou:169070********30:instance/i-bp1ecr********5go2go","userId": "169070********30","ver": "1.0","content": {"resourceId": "i-bp1ecr********5go2go", "resourceType": "ALIYUN::ECS::Instance","state": "Stopping"} }'),
  executionId?: string(name='ExecutionId', description='The ID of the event-, alert-, or timer-triggered execution.

This parameter is required.', example='exec-sadw3f23rsad'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  type?: string(name='Type', description='The type of the trigger. Valid values:

*   Event
*   Alarm
*   Timer

This parameter is required.', example='Event'),
}

model TriggerExecutionResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='14A07460-EBE7-47CA-9757-12CC4761D47A'),
}

model TriggerExecutionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TriggerExecutionResponseBody(name='body'),
}

/**
 * @summary Debugs a started execution that contains an event trigger task or alert trigger task. If the operation is called, a message body is sent to the event trigger task or alert trigger task. After the trigger task receives the message body, the trigger task generates a new child execution.
 *
 * @param request TriggerExecutionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return TriggerExecutionResponse
 */
async function triggerExecutionWithOptions(request: TriggerExecutionRequest, runtime: Util.RuntimeOptions): TriggerExecutionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.content)) {
    query['Content'] = request.content;
  }
  if (!Util.isUnset(request.executionId)) {
    query['ExecutionId'] = request.executionId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'TriggerExecution',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Debugs a started execution that contains an event trigger task or alert trigger task. If the operation is called, a message body is sent to the event trigger task or alert trigger task. After the trigger task receives the message body, the trigger task generates a new child execution.
 *
 * @param request TriggerExecutionRequest
 * @return TriggerExecutionResponse
 */
async function triggerExecution(request: TriggerExecutionRequest): TriggerExecutionResponse {
  var runtime = new Util.RuntimeOptions{};
  return triggerExecutionWithOptions(request, runtime);
}

model UntagResourcesRequest {
  all?: boolean(name='All', description='Specifies whether to remove all tags. This parameter takes effect only if TagKeys is left empty. Valid values: true and false. Default value: false. TagKeys is required if this parameter is set to false.', example='false'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  resourceIds?: map[string]any(name='ResourceIds', description='The IDs of the resources for which you want to modify the resource group. The number of resource IDs is 1 to 50.

*   If you set ResourceType to template, specify ResourceIds in the ["TemplateName1","TemplateName2"] format.
*   If you set ResourceType to parameter, specify ResourceIds in the ["Name1","Name2"] format.
*   If you set ResourceType to secretparameter, specify ResourceIds in the ["Name1","Name2"] format.
*   If you set ResourceType to stateconfiguration, specify ResourceIds in the ["StateConfigurationId 1","StateConfigurationId 2"] format.
*   If you set ResourceType to application, specify ResourceIds in the ["Name1","Name2"] format.

This parameter is required.', example='["templateName1","templateName2"]'),
  resourceType?: string(name='ResourceType', description='The type of the resource for which you want to modify the resource group. Valid values:

*   template: template.
*   parameter: parameter.
*   secretparameter: encryption parameter.
*   stateconfiguration: desired-state configuration.
*   application: application.

This parameter is required.', example='template'),
  tagKeys?: map[string]any(name='TagKeys', description='The tag keys. The number of keys ranges from 1 to 20.', example='["k1","k2"]'),
}

model UntagResourcesShrinkRequest {
  all?: boolean(name='All', description='Specifies whether to remove all tags. This parameter takes effect only if TagKeys is left empty. Valid values: true and false. Default value: false. TagKeys is required if this parameter is set to false.', example='false'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  resourceIdsShrink?: string(name='ResourceIds', description='The IDs of the resources for which you want to modify the resource group. The number of resource IDs is 1 to 50.

*   If you set ResourceType to template, specify ResourceIds in the ["TemplateName1","TemplateName2"] format.
*   If you set ResourceType to parameter, specify ResourceIds in the ["Name1","Name2"] format.
*   If you set ResourceType to secretparameter, specify ResourceIds in the ["Name1","Name2"] format.
*   If you set ResourceType to stateconfiguration, specify ResourceIds in the ["StateConfigurationId 1","StateConfigurationId 2"] format.
*   If you set ResourceType to application, specify ResourceIds in the ["Name1","Name2"] format.

This parameter is required.', example='["templateName1","templateName2"]'),
  resourceType?: string(name='ResourceType', description='The type of the resource for which you want to modify the resource group. Valid values:

*   template: template.
*   parameter: parameter.
*   secretparameter: encryption parameter.
*   stateconfiguration: desired-state configuration.
*   application: application.

This parameter is required.', example='template'),
  tagKeysShrink?: string(name='TagKeys', description='The tag keys. The number of keys ranges from 1 to 20.', example='["k1","k2"]'),
}

model UntagResourcesResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='491DF8C2-34C9-4679-9DB3-4C0F49B129AC'),
}

model UntagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UntagResourcesResponseBody(name='body'),
}

/**
 * @summary Removes tags from one or more resources.
 *
 * @param tmpReq UntagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UntagResourcesResponse
 */
async function untagResourcesWithOptions(tmpReq: UntagResourcesRequest, runtime: Util.RuntimeOptions): UntagResourcesResponse {
  Util.validateModel(tmpReq);
  var request = new UntagResourcesShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.resourceIds)) {
    request.resourceIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.resourceIds, 'ResourceIds', 'json');
  }
  if (!Util.isUnset(tmpReq.tagKeys)) {
    request.tagKeysShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tagKeys, 'TagKeys', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.all)) {
    query['All'] = request.all;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceIdsShrink)) {
    query['ResourceIds'] = request.resourceIdsShrink;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.tagKeysShrink)) {
    query['TagKeys'] = request.tagKeysShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UntagResources',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Removes tags from one or more resources.
 *
 * @param request UntagResourcesRequest
 * @return UntagResourcesResponse
 */
async function untagResources(request: UntagResourcesRequest): UntagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return untagResourcesWithOptions(request, runtime);
}

model UpdateApplicationRequest {
  alarmConfig?: {
    contactGroups?: [ string ](name='ContactGroups', description='The alert contact groups.'),
    healthCheckUrl?: string(name='HealthCheckUrl', description='The health check URL of the application.', example='/healthcheck/tcp50122'),
    templateIds?: [ string ](name='TemplateIds', description='The alert templates.'),
  }(name='AlarmConfig', description='The configurations of application alerts.'),
  deleteAlarmRulesBeforeUpdate?: boolean(name='DeleteAlarmRulesBeforeUpdate', description='Specifies whether to delete existing alert rules before applying the alert template. Default value: false.', example='false'),
  description?: string(name='Description', description='The description to be updated for the application.', example='test application'),
  name?: string(name='Name', description='The application name.

This parameter is required.', example='My-Application'),
  regionId?: string(name='RegionId', description='The region ID. Set the value to cn-hangzhou.', example='cn-hangzhou'),
  tags?: map[string]any(name='Tags', description='The tags.', example='{"k1":"v1","k2":"v2"}'),
}

model UpdateApplicationShrinkRequest {
  alarmConfigShrink?: string(name='AlarmConfig', description='The configurations of application alerts.'),
  deleteAlarmRulesBeforeUpdate?: boolean(name='DeleteAlarmRulesBeforeUpdate', description='Specifies whether to delete existing alert rules before applying the alert template. Default value: false.', example='false'),
  description?: string(name='Description', description='The description to be updated for the application.', example='test application'),
  name?: string(name='Name', description='The application name.

This parameter is required.', example='My-Application'),
  regionId?: string(name='RegionId', description='The region ID. Set the value to cn-hangzhou.', example='cn-hangzhou'),
  tagsShrink?: string(name='Tags', description='The tags.', example='{"k1":"v1","k2":"v2"}'),
}

model UpdateApplicationResponseBody = {
  application?: {
    createdDate?: string(name='CreatedDate', description='The time when the application was created.', example='2021-09-07T09:17:46Z'),
    description?: string(name='Description', description='The description of the application.', example='test application'),
    name?: string(name='Name', description='The application name.', example='My-Application'),
    resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m*****'),
    tags?: map[string]any(name='Tags', description='The tags.', example='{"k1":"v1","k2":"v2"}'),
    updatedDate?: string(name='UpdatedDate', description='The time when the application was updated.', example='2021-09-07T10:17:46Z'),
  }(name='Application', description='The information about the application.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='F1F00F41-D24C-5377-831B-C97F739CE1AB'),
}

model UpdateApplicationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateApplicationResponseBody(name='body'),
}

/**
 * @summary Updates an application. You can call this operation only for the applications that reside in the China (Hangzhou) region. Use an endpoint of the China (Hangzhou) region.
 *
 * @param tmpReq UpdateApplicationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateApplicationResponse
 */
async function updateApplicationWithOptions(tmpReq: UpdateApplicationRequest, runtime: Util.RuntimeOptions): UpdateApplicationResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateApplicationShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.alarmConfig)) {
    request.alarmConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.alarmConfig, 'AlarmConfig', 'json');
  }
  if (!Util.isUnset(tmpReq.tags)) {
    request.tagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tags, 'Tags', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.alarmConfigShrink)) {
    query['AlarmConfig'] = request.alarmConfigShrink;
  }
  if (!Util.isUnset(request.deleteAlarmRulesBeforeUpdate)) {
    query['DeleteAlarmRulesBeforeUpdate'] = request.deleteAlarmRulesBeforeUpdate;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.tagsShrink)) {
    query['Tags'] = request.tagsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateApplication',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Updates an application. You can call this operation only for the applications that reside in the China (Hangzhou) region. Use an endpoint of the China (Hangzhou) region.
 *
 * @param request UpdateApplicationRequest
 * @return UpdateApplicationResponse
 */
async function updateApplication(request: UpdateApplicationRequest): UpdateApplicationResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateApplicationWithOptions(request, runtime);
}

model UpdateApplicationGroupRequest {
  applicationName?: string(name='ApplicationName', description='The application name.

This parameter is required.', example='MyApplication'),
  name?: string(name='Name', description='The name of the application group.

This parameter is required.', example='MyApplicationGroup'),
  newName?: string(name='NewName', description='The new name of the application group.', example='UpdateMyApplicationGroup'),
  operationName?: string(name='OperationName', description='The name of the configuration update operation.', example='/business/v1/product/spus/{spu_id}'),
  parameters?: map[string]any(name='Parameters', description='The JSON string that consists of a set of parameters. Default value: {}.', example='{"username": "xx"}'),
  regionId?: string(name='RegionId', description='The region ID. Set the value to cn-hangzhou.', example='cn-hangzhou'),
}

model UpdateApplicationGroupShrinkRequest {
  applicationName?: string(name='ApplicationName', description='The application name.

This parameter is required.', example='MyApplication'),
  name?: string(name='Name', description='The name of the application group.

This parameter is required.', example='MyApplicationGroup'),
  newName?: string(name='NewName', description='The new name of the application group.', example='UpdateMyApplicationGroup'),
  operationName?: string(name='OperationName', description='The name of the configuration update operation.', example='/business/v1/product/spus/{spu_id}'),
  parametersShrink?: string(name='Parameters', description='The JSON string that consists of a set of parameters. Default value: {}.', example='{"username": "xx"}'),
  regionId?: string(name='RegionId', description='The region ID. Set the value to cn-hangzhou.', example='cn-hangzhou'),
}

model UpdateApplicationGroupResponseBody = {
  applicationGroup?: {
    applicationName?: string(name='ApplicationName', description='The application name.', example='MyApplication'),
    createdDate?: string(name='CreatedDate', description='The time when the application group was created.', example='2021-09-07T10:28:25Z'),
    deployRegionId?: string(name='DeployRegionId', description='The ID of the region in which the related resources reside.', example='cn-hangzhou'),
    description?: string(name='Description', description='The description of the application group.', example='ApplicationGroup'),
    importTagKey?: string(name='ImportTagKey', description='The key of the tag.', example='k1'),
    importTagValue?: string(name='ImportTagValue', description='The value of the tag.', example='v1'),
    name?: string(name='Name', description='The name of the application group.', example='UpdateMyApplicationGroup'),
    updatedDate?: string(name='UpdatedDate', description='The time when the application group was updated.', example='2021-09-08T03:01:53Z'),
  }(name='ApplicationGroup', description='The information about the application group.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='AA9FA778-AE4B-55EC-81CC-C46BAF08A166'),
}

model UpdateApplicationGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateApplicationGroupResponseBody(name='body'),
}

/**
 * @summary Updates the information of an application group. You can call this operation only for the application groups that reside in the China (Hangzhou) region. Use an endpoint of the China (Hangzhou) region.
 *
 * @param tmpReq UpdateApplicationGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateApplicationGroupResponse
 */
async function updateApplicationGroupWithOptions(tmpReq: UpdateApplicationGroupRequest, runtime: Util.RuntimeOptions): UpdateApplicationGroupResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateApplicationGroupShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.parameters)) {
    request.parametersShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.parameters, 'Parameters', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.applicationName)) {
    query['ApplicationName'] = request.applicationName;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.newName)) {
    query['NewName'] = request.newName;
  }
  if (!Util.isUnset(request.operationName)) {
    query['OperationName'] = request.operationName;
  }
  if (!Util.isUnset(request.parametersShrink)) {
    query['Parameters'] = request.parametersShrink;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateApplicationGroup',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Updates the information of an application group. You can call this operation only for the application groups that reside in the China (Hangzhou) region. Use an endpoint of the China (Hangzhou) region.
 *
 * @param request UpdateApplicationGroupRequest
 * @return UpdateApplicationGroupResponse
 */
async function updateApplicationGroup(request: UpdateApplicationGroupRequest): UpdateApplicationGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateApplicationGroupWithOptions(request, runtime);
}

model UpdateExecutionRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.', example='123e4567-e89b-12d3-a456-42665544****'),
  description?: string(name='Description', description='The description of the execution.', example='Execution description'),
  executionId?: string(name='ExecutionId', description='The ID of the execution.

This parameter is required.', example='exec-c223xxxxxxxxxxxxxxxx'),
  parameters?: string(name='Parameters', description='The information about the parameters.', example='{"Status":"Running"}'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m*****'),
  tags?: string(name='Tags', description='The tags of the execution.', example='{"k1": "v1", "k2": "v2"}'),
}

model UpdateExecutionResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='C8345E88-5334-469E-901D-F912C8CB9C55'),
}

model UpdateExecutionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateExecutionResponseBody(name='body'),
}

/**
 * @summary Update executions that are in Running or Waiting status.
 *
 * @param request UpdateExecutionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateExecutionResponse
 */
async function updateExecutionWithOptions(request: UpdateExecutionRequest, runtime: Util.RuntimeOptions): UpdateExecutionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.executionId)) {
    query['ExecutionId'] = request.executionId;
  }
  if (!Util.isUnset(request.parameters)) {
    query['Parameters'] = request.parameters;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.tags)) {
    query['Tags'] = request.tags;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateExecution',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Update executions that are in Running or Waiting status.
 *
 * @param request UpdateExecutionRequest
 * @return UpdateExecutionResponse
 */
async function updateExecution(request: UpdateExecutionRequest): UpdateExecutionResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateExecutionWithOptions(request, runtime);
}

model UpdateInstancePackageStateRequest {
  configureAction?: string(name='ConfigureAction', description='The operation type.

Valid values:

*   uninstall
*   install

This parameter is required.', example='install'),
  instanceId?: string(name='InstanceId', description='The ID of the Elastic Compute Service (ECS) instance.

This parameter is required.', example='i-bp1jaxa2bs4bps7*****'),
  parameters?: map[string]any(name='Parameters', description='The parameters for installing or uninstalling the extensions.', example='{"username": "xx"}'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  templateName?: string(name='TemplateName', description='The name of the template.

This parameter is required.', example='ACS-ECS-InventoryDataCollection'),
  templateVersion?: string(name='TemplateVersion', description='The version of the template.', example='v1'),
}

model UpdateInstancePackageStateShrinkRequest {
  configureAction?: string(name='ConfigureAction', description='The operation type.

Valid values:

*   uninstall
*   install

This parameter is required.', example='install'),
  instanceId?: string(name='InstanceId', description='The ID of the Elastic Compute Service (ECS) instance.

This parameter is required.', example='i-bp1jaxa2bs4bps7*****'),
  parametersShrink?: string(name='Parameters', description='The parameters for installing or uninstalling the extensions.', example='{"username": "xx"}'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  templateName?: string(name='TemplateName', description='The name of the template.

This parameter is required.', example='ACS-ECS-InventoryDataCollection'),
  templateVersion?: string(name='TemplateVersion', description='The version of the template.', example='v1'),
}

model UpdateInstancePackageStateResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='2597E94B-5346-42D1-BB58-XXXXXXXXXXX'),
}

model UpdateInstancePackageStateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateInstancePackageStateResponseBody(name='body'),
}

/**
 * @summary Updates the installed extensions of an instance.
 *
 * @param tmpReq UpdateInstancePackageStateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateInstancePackageStateResponse
 */
async function updateInstancePackageStateWithOptions(tmpReq: UpdateInstancePackageStateRequest, runtime: Util.RuntimeOptions): UpdateInstancePackageStateResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateInstancePackageStateShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.parameters)) {
    request.parametersShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.parameters, 'Parameters', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.configureAction)) {
    query['ConfigureAction'] = request.configureAction;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.parametersShrink)) {
    query['Parameters'] = request.parametersShrink;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.templateName)) {
    query['TemplateName'] = request.templateName;
  }
  if (!Util.isUnset(request.templateVersion)) {
    query['TemplateVersion'] = request.templateVersion;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateInstancePackageState',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Updates the installed extensions of an instance.
 *
 * @param request UpdateInstancePackageStateRequest
 * @return UpdateInstancePackageStateResponse
 */
async function updateInstancePackageState(request: UpdateInstancePackageStateRequest): UpdateInstancePackageStateResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateInstancePackageStateWithOptions(request, runtime);
}

model UpdateOpsItemRequest {
  category?: string(name='Category', description='The category.', example='Security'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.', example='DASKJJLKADS-AHKLJHJSAKL-AJK'),
  dedupString?: string(name='DedupString', description='The string to be deduplicated.', example='ecs_instance_SystemMaintenance.Reboot'),
  description?: string(name='Description', description='The description of the O\\\\&M item.', example='test-update'),
  opsItemId?: string(name='OpsItemId', description='The ID of the O\\\\&M item.', example='oi-e2264dcf040c472598e9'),
  priority?: int32(name='Priority', description='The priority.', example='2'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
  resources?: string(name='Resources', description='The Alibaba Resource Names (ARNs) of the associated resources.', example='[\\\\"arn:acs:ecs:cn-heyuan:1139354755361920:instance/i-f8z928h7aqotd3o65032\\\\"]'),
  severity?: string(name='Severity', description='The severity level.', example='Medium'),
  solutions?: string(name='Solutions', description='The solutions.', example='[{\\\\n \\\\\\\\"priority\\\\\\\\":3,\\\\n \\\\\\\\"type\\\\\\\\":\\\\\\\\"url\\\\\\\\",\\\\n \\\\\\\\"url\\\\\\\\":\\\\\\\\"https://example.com\\\\\\\\",\\\\n \\\\\\\\"description\\\\\\\\":\\\\\\\\"Specify a cross-zone high availability cluster. \\\\\\\\"\\\\n}]'),
  source?: string(name='Source', description='The source business.', example='/aliyun/ecs'),
  status?: string(name='Status', description='The status.', example='Open'),
  tags?: map[string]any(name='Tags', description='The tags.', example='{
      "k1": "v1",
      "k2": "v2"
}'),
  title?: string(name='Title', description='The title of the O\\\\&M item.', example='Test'),
}

model UpdateOpsItemShrinkRequest {
  category?: string(name='Category', description='The category.', example='Security'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.', example='DASKJJLKADS-AHKLJHJSAKL-AJK'),
  dedupString?: string(name='DedupString', description='The string to be deduplicated.', example='ecs_instance_SystemMaintenance.Reboot'),
  description?: string(name='Description', description='The description of the O\\\\&M item.', example='test-update'),
  opsItemId?: string(name='OpsItemId', description='The ID of the O\\\\&M item.', example='oi-e2264dcf040c472598e9'),
  priority?: int32(name='Priority', description='The priority.', example='2'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
  resources?: string(name='Resources', description='The Alibaba Resource Names (ARNs) of the associated resources.', example='[\\\\"arn:acs:ecs:cn-heyuan:1139354755361920:instance/i-f8z928h7aqotd3o65032\\\\"]'),
  severity?: string(name='Severity', description='The severity level.', example='Medium'),
  solutions?: string(name='Solutions', description='The solutions.', example='[{\\\\n \\\\\\\\"priority\\\\\\\\":3,\\\\n \\\\\\\\"type\\\\\\\\":\\\\\\\\"url\\\\\\\\",\\\\n \\\\\\\\"url\\\\\\\\":\\\\\\\\"https://example.com\\\\\\\\",\\\\n \\\\\\\\"description\\\\\\\\":\\\\\\\\"Specify a cross-zone high availability cluster. \\\\\\\\"\\\\n}]'),
  source?: string(name='Source', description='The source business.', example='/aliyun/ecs'),
  status?: string(name='Status', description='The status.', example='Open'),
  tagsShrink?: string(name='Tags', description='The tags.', example='{
      "k1": "v1",
      "k2": "v2"
}'),
  title?: string(name='Title', description='The title of the O\\\\&M item.', example='Test'),
}

model UpdateOpsItemResponseBody = {
  opsItem?: {
    attributes?: string(name='Attributes', description='The attributes of the O\\\\&M item.', example='[{\\\\"Attribute\\\\": {\\\\"Weight\\\\": 100}, \\\\"RealServer\\\\": \\\\"uaejc8hnqzqz5valyh8dibolpvza48ik.yundunwaf5.com\\\\"}]'),
    category?: string(name='Category', description='The category.', example='Security'),
    createDate?: string(name='CreateDate', description='The time when the O\\\\&M item was created.', example='2023-03-16T07:04Z'),
    createdBy?: string(name='CreatedBy', description='The user who created the patch baseline.', example='root(130900000)'),
    description?: string(name='Description', description='The description.', example='test-update'),
    lastModifiedBy?: string(name='LastModifiedBy', description='The user who modified the O\\\\&M item.', example='root(130900000)'),
    opsItemId?: string(name='OpsItemId', description='The ID of the O\\\\&M item.', example='oi-e2264dcf040c472598e9'),
    priority?: int32(name='Priority', description='The priority.', example='2'),
    resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
    resources?: [ string ](name='Resources', description='The ARNs of the associated resources.'),
    severity?: string(name='Severity', description='The severity level.', example='Medium'),
    solutions?: [ string ](name='Solutions', description='The solutions.'),
    source?: string(name='Source', description='The source business.', example='/aliyun/ecs'),
    status?: string(name='Status', description='The status.', example='Open'),
    tags?: map[string]any(name='Tags', description='The tags.', example='{
      "k1": "v1",
      "k2": "v2"
}'),
    title?: string(name='Title', description='The title of the O\\\\&M item.', example='Test'),
    updateDate?: string(name='UpdateDate', description='The time when the O\\\\&M item was updated.', example='2023-03-16T08:04Z'),
  }(name='OpsItem', description='The information about the O\\\\&M item.'),
  requestId?: string(name='RequestId', description='The request ID.', example='C996DECB-3D2B-5321-B359-BE7031B6399E'),
}

model UpdateOpsItemResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateOpsItemResponseBody(name='body'),
}

/**
 * @summary Modifies an O\\\\\\\\\\\\&M item.
 *
 * @param tmpReq UpdateOpsItemRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateOpsItemResponse
 */
async function updateOpsItemWithOptions(tmpReq: UpdateOpsItemRequest, runtime: Util.RuntimeOptions): UpdateOpsItemResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateOpsItemShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.tags)) {
    request.tagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tags, 'Tags', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.category)) {
    query['Category'] = request.category;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dedupString)) {
    query['DedupString'] = request.dedupString;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.opsItemId)) {
    query['OpsItemId'] = request.opsItemId;
  }
  if (!Util.isUnset(request.priority)) {
    query['Priority'] = request.priority;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resources)) {
    query['Resources'] = request.resources;
  }
  if (!Util.isUnset(request.severity)) {
    query['Severity'] = request.severity;
  }
  if (!Util.isUnset(request.solutions)) {
    query['Solutions'] = request.solutions;
  }
  if (!Util.isUnset(request.source)) {
    query['Source'] = request.source;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.tagsShrink)) {
    query['Tags'] = request.tagsShrink;
  }
  if (!Util.isUnset(request.title)) {
    query['Title'] = request.title;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateOpsItem',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies an O\\\\\\\\\\\\&M item.
 *
 * @param request UpdateOpsItemRequest
 * @return UpdateOpsItemResponse
 */
async function updateOpsItem(request: UpdateOpsItemRequest): UpdateOpsItemResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateOpsItemWithOptions(request, runtime);
}

model UpdateParameterRequest {
  description?: string(name='Description', description='The description of the common parameter. The description must be 1 to 200 characters in length.', example='update'),
  name?: string(name='Name', description='The name of the common parameter. The name must be 1 to 200 characters in length, and can contain letters, digits, hyphens (-), and underscores (_). It cannot start with ALIYUN, ACS, ALIBABA, ALICLOUD, or OOS.

This parameter is required.', example='MyParameter'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-acfmxsn4m4******'),
  tags?: string(name='Tags', description='The tags to be added to common parameter.', example='{"k1": "v1", "k2": "v2"}'),
  value?: string(name='Value', description='The value of the common parameter. The value must be 1 to 4,096 characters in length.

This parameter is required.', example='update'),
}

model UpdateParameterResponseBody = {
  parameter?: {
    constraints?: string(name='Constraints', description='The constraints of the common parameter.', example='"{\\\\"AllowedValues\\\\":[\\\\"parameter\\\\"],\\\\"AllowedPattern\\\\":\\\\"parameter\\\\",\\\\"MinLength\\\\":0,\\\\"MaxLength\\\\":20}"'),
    createdBy?: string(name='CreatedBy', description='The user who created the common parameter.', example='root(130900000)'),
    createdDate?: string(name='CreatedDate', description='The time when the common parameter was created.', example='2020-09-01T08:01:43Z'),
    description?: string(name='Description', description='The description of the common parameter.', example='update'),
    id?: string(name='Id', description='The parameter ID.', example='p-4c4b401cab6747xxxxxx'),
    name?: string(name='Name', description='The name of the common parameter.', example='MyParameter'),
    parameterVersion?: int32(name='ParameterVersion', description='The version number of the common parameter.', example='2'),
    resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-acfmxsn4m4******'),
    shareType?: string(name='ShareType', description='The share type of the common parameter.', example='Private'),
    tags?: string(name='Tags', description='The tag added to the common parameter.', example='{"k1": "v1", "k2": "v2"}'),
    type?: string(name='Type', description='The data type of the common parameter.', example='String'),
    updatedBy?: string(name='UpdatedBy', description='The user who updated the common parameter.', example='root(130900000)'),
    updatedDate?: string(name='UpdatedDate', description='The time when the common parameter was updated.', example='2020-09-01T08:04:23Z'),
  }(name='Parameter', description='The information about the common parameter.'),
  requestId?: string(name='RequestId', description='The request ID.', example='AF1AE6DE-61C4-435E-8687-072CFACCCEC7'),
}

model UpdateParameterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateParameterResponseBody(name='body'),
}

/**
 * @summary Updates a common parameter.
 *
 * @param request UpdateParameterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateParameterResponse
 */
async function updateParameterWithOptions(request: UpdateParameterRequest, runtime: Util.RuntimeOptions): UpdateParameterResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.tags)) {
    query['Tags'] = request.tags;
  }
  if (!Util.isUnset(request.value)) {
    query['Value'] = request.value;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateParameter',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Updates a common parameter.
 *
 * @param request UpdateParameterRequest
 * @return UpdateParameterResponse
 */
async function updateParameter(request: UpdateParameterRequest): UpdateParameterResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateParameterWithOptions(request, runtime);
}

model UpdatePatchBaselineRequest {
  approvalRules?: string(name='ApprovalRules', description='The rules of scanning and installing patches for the specified operating system.', example='{"PatchRules":[{"PatchFilterGroup":[{"Key":"PatchSet","Values":["OS"]},{"Key":"ProductFamily","Values":["Windows"]},{"Key":"Product","Values":["Windows 10","Windows 7"]},{"Key":"Classification","Values":["Security Updates","Updates","Update Rollups","Critical Updates"]},{"Key":"Severity","Values":["Critical","Important","Moderate"]}],"ApproveAfterDays":7,"ApproveUntilDate":"","EnableNonSecurity":true,"ComplianceLevel":"Medium"}]}'),
  approvedPatches?: [ string ](name='ApprovedPatches', description='The approved patches.'),
  approvedPatchesEnableNonSecurity?: boolean(name='ApprovedPatchesEnableNonSecurity', description='Indicates whether the approved patch involves updates other than security-related updates.', example='true'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.', example='-'),
  description?: string(name='Description', description='The description of the patch baseline.', example='UpdatePatchBaseline'),
  name?: string(name='Name', description='The name of the patch baseline.

This parameter is required.', example='MyPatchBaseline'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
  rejectedPatches?: [ string ](name='RejectedPatches', description='The rejected patches.'),
  rejectedPatchesAction?: string(name='RejectedPatchesAction', description='The action of the rejected patch.', example='ALLOW_AS_DEPENDENCY'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
  sources?: [ string ](name='Sources', description='The patch source configurations.'),
  tags?: [ 
    {
      key?: string(name='Key', description='The key of the tag.', example='key'),
      value?: string(name='Value', description='The value of the tag.', example='value'),
    }
  ](name='Tags', description='The tags.'),
}

model UpdatePatchBaselineShrinkRequest {
  approvalRules?: string(name='ApprovalRules', description='The rules of scanning and installing patches for the specified operating system.', example='{"PatchRules":[{"PatchFilterGroup":[{"Key":"PatchSet","Values":["OS"]},{"Key":"ProductFamily","Values":["Windows"]},{"Key":"Product","Values":["Windows 10","Windows 7"]},{"Key":"Classification","Values":["Security Updates","Updates","Update Rollups","Critical Updates"]},{"Key":"Severity","Values":["Critical","Important","Moderate"]}],"ApproveAfterDays":7,"ApproveUntilDate":"","EnableNonSecurity":true,"ComplianceLevel":"Medium"}]}'),
  approvedPatchesShrink?: string(name='ApprovedPatches', description='The approved patches.'),
  approvedPatchesEnableNonSecurity?: boolean(name='ApprovedPatchesEnableNonSecurity', description='Indicates whether the approved patch involves updates other than security-related updates.', example='true'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.', example='-'),
  description?: string(name='Description', description='The description of the patch baseline.', example='UpdatePatchBaseline'),
  name?: string(name='Name', description='The name of the patch baseline.

This parameter is required.', example='MyPatchBaseline'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
  rejectedPatchesShrink?: string(name='RejectedPatches', description='The rejected patches.'),
  rejectedPatchesAction?: string(name='RejectedPatchesAction', description='The action of the rejected patch.', example='ALLOW_AS_DEPENDENCY'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
  sourcesShrink?: string(name='Sources', description='The patch source configurations.'),
  tagsShrink?: string(name='Tags', description='The tags.'),
}

model UpdatePatchBaselineResponseBody = {
  patchBaseline?: {
    approvalRules?: string(name='ApprovalRules', description='The rules of scanning and installing patches for the specified operating system.', example='{"PatchRules":[{"PatchFilterGroup":[{"Key":"PatchSet","Values":["OS"]},{"Key":"ProductFamily","Values":["Windows"]},{"Key":"Product","Values":["Windows 10","Windows 7"]},{"Key":"Classification","Values":["Security Updates","Updates","Update Rollups","Critical Updates"]},{"Key":"Severity","Values":["Critical","Important","Moderate"]}],"ApproveAfterDays":7,"ApproveUntilDate":"","EnableNonSecurity":true,"ComplianceLevel":"Medium"}]}'),
    approvedPatches?: [ string ](name='ApprovedPatches', description='The approved patches.'),
    approvedPatchesEnableNonSecurity?: boolean(name='ApprovedPatchesEnableNonSecurity', description='Indicates whether the approved patch involves updates other than security-related updates.', example='true'),
    createdBy?: string(name='CreatedBy', description='The creator of the patch baseline.', example='root(130900000)'),
    createdDate?: string(name='CreatedDate', description='The time when the patch baseline was created.', example='2021-09-07T03:42:56Z'),
    description?: string(name='Description', description='The description of the patch baseline.', example='UpdatePatchBaseline'),
    id?: string(name='Id', description='The ID of the patch baseline.', example='pb-445340b5c6504a85a300'),
    name?: string(name='Name', description='The name of the patch baseline.', example='MyPatchBaseline'),
    operationSystem?: string(name='OperationSystem', description='The operating system.', example='Windows'),
    rejectedPatches?: [ string ](name='RejectedPatches', description='The rejected patches.'),
    rejectedPatchesAction?: string(name='RejectedPatchesAction', description='The action of the rejected patch.', example='ALLOW_AS_DEPENDENCY'),
    resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmy2zdbbjplii'),
    shareType?: string(name='ShareType', description='The share type of the patch baseline.', example='Private'),
    sources?: [ string ](name='Sources', description='The patch source configurations.'),
    tags?: [ 
      {
        tagKey?: string(name='TagKey', description='The key of the tag.', example='key'),
        tagValue?: string(name='TagValue', description='The value of the tag.', example='value'),
      }
    ](name='Tags', description='The tags.'),
    updatedBy?: string(name='UpdatedBy', description='The user who updated the patch baseline.', example='root(130900000)'),
    updatedDate?: string(name='UpdatedDate', description='The time when the patch baseline was updated.', example='2021-09-08T07:26:37Z'),
  }(name='PatchBaseline', description='The details of the patch baseline.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='1457F46C-7AAE-59FA-BD12-0BDB3751E6F8'),
}

model UpdatePatchBaselineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdatePatchBaselineResponseBody(name='body'),
}

/**
 * @summary Updates a patch baseline.
 *
 * @param tmpReq UpdatePatchBaselineRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdatePatchBaselineResponse
 */
async function updatePatchBaselineWithOptions(tmpReq: UpdatePatchBaselineRequest, runtime: Util.RuntimeOptions): UpdatePatchBaselineResponse {
  Util.validateModel(tmpReq);
  var request = new UpdatePatchBaselineShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.approvedPatches)) {
    request.approvedPatchesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.approvedPatches, 'ApprovedPatches', 'json');
  }
  if (!Util.isUnset(tmpReq.rejectedPatches)) {
    request.rejectedPatchesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.rejectedPatches, 'RejectedPatches', 'json');
  }
  if (!Util.isUnset(tmpReq.sources)) {
    request.sourcesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.sources, 'Sources', 'json');
  }
  if (!Util.isUnset(tmpReq.tags)) {
    request.tagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tags, 'Tags', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.approvalRules)) {
    query['ApprovalRules'] = request.approvalRules;
  }
  if (!Util.isUnset(request.approvedPatchesShrink)) {
    query['ApprovedPatches'] = request.approvedPatchesShrink;
  }
  if (!Util.isUnset(request.approvedPatchesEnableNonSecurity)) {
    query['ApprovedPatchesEnableNonSecurity'] = request.approvedPatchesEnableNonSecurity;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.rejectedPatchesShrink)) {
    query['RejectedPatches'] = request.rejectedPatchesShrink;
  }
  if (!Util.isUnset(request.rejectedPatchesAction)) {
    query['RejectedPatchesAction'] = request.rejectedPatchesAction;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.sourcesShrink)) {
    query['Sources'] = request.sourcesShrink;
  }
  if (!Util.isUnset(request.tagsShrink)) {
    query['Tags'] = request.tagsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdatePatchBaseline',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Updates a patch baseline.
 *
 * @param request UpdatePatchBaselineRequest
 * @return UpdatePatchBaselineResponse
 */
async function updatePatchBaseline(request: UpdatePatchBaselineRequest): UpdatePatchBaselineResponse {
  var runtime = new Util.RuntimeOptions{};
  return updatePatchBaselineWithOptions(request, runtime);
}

model UpdateSecretParameterRequest {
  description?: string(name='Description', description='The description of the parameter. The description must be 1 to 200 characters in length.', example='SecretParameter'),
  name?: string(name='Name', description='The name of the parameter. The name must be 1 to 180 characters in length, and can contain letters, digits, hyphens (-), and underscores (_). It cannot start with ALIYUN, ACS, ALIBABA, ALICLOUD, or OOS.

This parameter is required.', example='MySecretParameter'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
  tags?: map[string]any(name='Tags', description='The tags of the parameter.', example='{"k1": "v1", "k2": "v2"}'),
  value?: string(name='Value', description='The value of the parameter. The value must be 1 to 4096 characters in length.

This parameter is required.', example='update'),
}

model UpdateSecretParameterShrinkRequest {
  description?: string(name='Description', description='The description of the parameter. The description must be 1 to 200 characters in length.', example='SecretParameter'),
  name?: string(name='Name', description='The name of the parameter. The name must be 1 to 180 characters in length, and can contain letters, digits, hyphens (-), and underscores (_). It cannot start with ALIYUN, ACS, ALIBABA, ALICLOUD, or OOS.

This parameter is required.', example='MySecretParameter'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
  tagsShrink?: string(name='Tags', description='The tags of the parameter.', example='{"k1": "v1", "k2": "v2"}'),
  value?: string(name='Value', description='The value of the parameter. The value must be 1 to 4096 characters in length.

This parameter is required.', example='update'),
}

model UpdateSecretParameterResponseBody = {
  parameter?: {
    constraints?: string(name='Constraints', description='The constraints of the parameter.', example='\\\\"{\\\\"\\\\"AllowedValues":["secretparameter"],"AllowedPattern":".*","MinLength":0,"MaxLength":20}\\\\"'),
    createdBy?: string(name='CreatedBy', description='The user who created the parameter.', example='root(130900000)'),
    createdDate?: string(name='CreatedDate', description='The time when the parameter was created.', example='2020-09-01T09:30:36Z'),
    description?: string(name='Description', description='The description of the parameter.', example='SecretParameter'),
    id?: string(name='Id', description='The ID of the parameter.', example='p-0b0fff9919c946xxxxxx'),
    keyId?: string(name='KeyId', description='The ID of customer master key (CMK) of Key Management Service (KMS) that is used for encryption.', example='80e9409f-78fa-42ab-84bd-83f40c******'),
    name?: string(name='Name', description='The name of the parameter.', example='MyParameter'),
    parameterVersion?: int32(name='ParameterVersion', description='The version number of the parameter.', example='2'),
    resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
    shareType?: string(name='ShareType', description='The share type of the parameter.', example='Private'),
    tags?: string(name='Tags', description='The tags of the parameter.', example='{"k1": "v1", "k2": "v2"}'),
    type?: string(name='Type', description='The type of the parameter.', example='Secret'),
    updatedBy?: string(name='UpdatedBy', description='The user who updated the parameter.', example='root(130900000)'),
    updatedDate?: string(name='UpdatedDate', description='The time when the parameter was updated.', example='2020-09-01T09:33:11Z'),
  }(name='Parameter', description='The information about the parameter.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='0B419FF3-ABC6-4DF0-95E5-636DC8CBB8AF'),
}

model UpdateSecretParameterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateSecretParameterResponseBody(name='body'),
}

/**
 * @summary Updates an encryption parameter.
 *
 * @param tmpReq UpdateSecretParameterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateSecretParameterResponse
 */
async function updateSecretParameterWithOptions(tmpReq: UpdateSecretParameterRequest, runtime: Util.RuntimeOptions): UpdateSecretParameterResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateSecretParameterShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.tags)) {
    request.tagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tags, 'Tags', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.tagsShrink)) {
    query['Tags'] = request.tagsShrink;
  }
  if (!Util.isUnset(request.value)) {
    query['Value'] = request.value;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateSecretParameter',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Updates an encryption parameter.
 *
 * @param request UpdateSecretParameterRequest
 * @return UpdateSecretParameterResponse
 */
async function updateSecretParameter(request: UpdateSecretParameterRequest): UpdateSecretParameterResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateSecretParameterWithOptions(request, runtime);
}

model UpdateStateConfigurationRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.', example='DASKJJLKADS-AHKLJHJSAKL-AJK'),
  configureMode?: string(name='ConfigureMode', description='The configuration mode. Valid values: ApplyOnce: The configuration is applied only once. After a configuration is updated, the new configuration is applied. ApplyAndMonitor: The configuration is applied only once. After the configuration is applied, the system only checks whether the configuration is migrated in the future. ApplyAndAutoCorrect: The configuration is always applied.', example='ApplyOnce'),
  description?: string(name='Description', description='The description.', example='ACS-ECS-InventoryDataCollection'),
  parameters?: map[string]any(name='Parameters', description='The parameters.', example='{ "policy": { "ACS:Application": { "Collection": "Enabled" }, "ACS:Network": { "Collection": "Enabled" } } }'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-acfmxsn4m4******'),
  scheduleExpression?: string(name='ScheduleExpression', description='The schedule expression.', example='1 hour'),
  scheduleType?: string(name='ScheduleType', description='The schedule type.', example='rate'),
  stateConfigurationId?: string(name='StateConfigurationId', description='The ID of the desired-state configuration.

This parameter is required.', example='sc-asfgdhj12345'),
  tags?: map[string]any(name='Tags', description='The tags to be added to the configuration.', example='{"Key": "oos", "Value": "sc"}'),
  targets?: string(name='Targets', description='The resources to be queried.', example='{ "ResourceType": "ALIYUN::ECS::Instance", "Filters": [ { "Type": "All", "RegionId": "cn-hangzhou", "Parameters": { "RegionId": "cn-hangzhou", "Status": "Running" } } ] }'),
}

model UpdateStateConfigurationShrinkRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.', example='DASKJJLKADS-AHKLJHJSAKL-AJK'),
  configureMode?: string(name='ConfigureMode', description='The configuration mode. Valid values: ApplyOnce: The configuration is applied only once. After a configuration is updated, the new configuration is applied. ApplyAndMonitor: The configuration is applied only once. After the configuration is applied, the system only checks whether the configuration is migrated in the future. ApplyAndAutoCorrect: The configuration is always applied.', example='ApplyOnce'),
  description?: string(name='Description', description='The description.', example='ACS-ECS-InventoryDataCollection'),
  parametersShrink?: string(name='Parameters', description='The parameters.', example='{ "policy": { "ACS:Application": { "Collection": "Enabled" }, "ACS:Network": { "Collection": "Enabled" } } }'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-acfmxsn4m4******'),
  scheduleExpression?: string(name='ScheduleExpression', description='The schedule expression.', example='1 hour'),
  scheduleType?: string(name='ScheduleType', description='The schedule type.', example='rate'),
  stateConfigurationId?: string(name='StateConfigurationId', description='The ID of the desired-state configuration.

This parameter is required.', example='sc-asfgdhj12345'),
  tagsShrink?: string(name='Tags', description='The tags to be added to the configuration.', example='{"Key": "oos", "Value": "sc"}'),
  targets?: string(name='Targets', description='The resources to be queried.', example='{ "ResourceType": "ALIYUN::ECS::Instance", "Filters": [ { "Type": "All", "RegionId": "cn-hangzhou", "Parameters": { "RegionId": "cn-hangzhou", "Status": "Running" } } ] }'),
}

model UpdateStateConfigurationResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1306108F-610C-40FD-AAD5-DA13E8B00BE9'),
  stateConfiguration?: [ 
    {
      configureMode?: string(name='ConfigureMode', description='The configuration mode. Valid values:', example='ApplyAndAutoCorrect'),
      createTime?: string(name='CreateTime', description='The time when the configuration was created.', example='2021-03-22T03:13:32Z'),
      description?: string(name='Description', description='The description of the desired-state configuration.', example='collect inventory data'),
      parameters?: string(name='Parameters', description='The parameters.', example='{"policy": {"ACS:Network": {"Collection": "Enabled"}, "ACS:Application": {"Collection": "Enabled"}}}'),
      resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-acfmxsn4m4******'),
      scheduleExpression?: string(name='ScheduleExpression', description='The CRON expression.', example='1 hour'),
      scheduleType?: string(name='ScheduleType', description='The schedule type.', example='rate'),
      stateConfigurationId?: string(name='StateConfigurationId', description='The ID of the desired-state configuration.', example='StateConfigurationId'),
      tags?: map[string]any(name='Tags', description='The tags added to the configuration.', example='{"Key": "oos", "Value": "inventory"}'),
      targets?: string(name='Targets', description='The queried resources.', example='{ "ResourceType": "ALIYUN::ECS::Instance", "Filters": [ { "Type": "All", "RegionId": "cn-hangzhou", "Parameters": { "RegionId": "cn-hangzhou", "Status": "Running" } } ] }'),
      templateId?: string(name='TemplateId', description='The template ID.', example='t-1234asadf'),
      templateName?: string(name='TemplateName', description='The name of the template.', example='ACS-ECS-InventoryDataCollection'),
      templateVersion?: string(name='TemplateVersion', description='The name of the template version.', example='v1'),
      updateTime?: string(name='UpdateTime', description='The time when the configuration was updated.', example='2021-03-22T03:13:32Z'),
    }
  ](name='StateConfiguration', description='The details of the configuration.'),
}

model UpdateStateConfigurationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateStateConfigurationResponseBody(name='body'),
}

/**
 * @summary Updates a desired-state configuration.
 *
 * @param tmpReq UpdateStateConfigurationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateStateConfigurationResponse
 */
async function updateStateConfigurationWithOptions(tmpReq: UpdateStateConfigurationRequest, runtime: Util.RuntimeOptions): UpdateStateConfigurationResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateStateConfigurationShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.parameters)) {
    request.parametersShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.parameters, 'Parameters', 'json');
  }
  if (!Util.isUnset(tmpReq.tags)) {
    request.tagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tags, 'Tags', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.configureMode)) {
    query['ConfigureMode'] = request.configureMode;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.parametersShrink)) {
    query['Parameters'] = request.parametersShrink;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.scheduleExpression)) {
    query['ScheduleExpression'] = request.scheduleExpression;
  }
  if (!Util.isUnset(request.scheduleType)) {
    query['ScheduleType'] = request.scheduleType;
  }
  if (!Util.isUnset(request.stateConfigurationId)) {
    query['StateConfigurationId'] = request.stateConfigurationId;
  }
  if (!Util.isUnset(request.tagsShrink)) {
    query['Tags'] = request.tagsShrink;
  }
  if (!Util.isUnset(request.targets)) {
    query['Targets'] = request.targets;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateStateConfiguration',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Updates a desired-state configuration.
 *
 * @param request UpdateStateConfigurationRequest
 * @return UpdateStateConfigurationResponse
 */
async function updateStateConfiguration(request: UpdateStateConfigurationRequest): UpdateStateConfigurationResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateStateConfigurationWithOptions(request, runtime);
}

model UpdateTemplateRequest {
  content?: string(name='Content', description='The content of the template. The content must be in the JSON or YAML format, and its maximum size is 64 KB.

This parameter is required.', example='{ "FormatVersion": "OOS-2019-06-01", "Description": { "en": "Bulky starts the ECS instances", "name-en": "Bulky Start Instances", }, "Parameters": { "regionId": { "Type": "String", "Label": { "en": "RegionId", }, "AssociationProperty": "RegionId", "Default": "{{ ACS::RegionId }}" }, "targets": { "Type": "Json", "Label": { "en": "TargetInstance", }, "AssociationProperty": "Targets", "AssociationPropertyMetadata": { "ResourceType": "ALIYUN::ECS::Instance", "RegionId": "regionId" } }, "rateControl": { "Label": { "en": "RateControl", }, "Type": "Json", "AssociationProperty": "RateControl", "Default": { "Mode": "Concurrency", "MaxErrors": 0, "Concurrency": 10 } }, "OOSAssumeRole": { "Label": { "en": "OOSAssumeRole", }, "Type": "String", "Default": "OOSServiceRole" } }, "RamRole": "{{ OOSAssumeRole }}", "Tasks": [ { "Name": "getInstance", "Description": { "en": "Views the ECS instances", }, "Action": "ACS::SelectTargets", "Properties": { "ResourceType": "ALIYUN::ECS::Instance", "RegionId": "{{ regionId }}", "Filters": [ "{{ targets }}" ] }, "Outputs": { "instanceIds": { "Type": "List", "ValueSelector": "Instances.Instance[].InstanceId" } } }, { "Name": "startInstance", "Action": "ACS::ECS::StartInstance", "Description": { "en": "Starts the ECS instances", }, "Properties": { "regionId": "{{ regionId }}", "instanceId": "{{ ACS::TaskLoopItem }}" }, "Loop": { "RateControl": "{{ rateControl }}", "Items": "{{ getInstance.instanceIds }}" } } ], "Outputs": { "instanceIds": { "Type": "List", "Value": "{{ getInstance.instanceIds }}" } } }'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
  tags?: map[string]any(name='Tags', description='The tag keys and values. The number of key-value pairs ranges from 1 to 20.', example='{"k1":"k2","k2":"v2"}'),
  templateName?: string(name='TemplateName', description='The name of the template. The name can be up to 200 characters in length and can contain letters, digits, hyphens (-), and underscores (_). The name cannot start with ALIYUN, ACS, ALIBABA, or ALICLOUD.

This parameter is required.', example='MyTemplate'),
  versionName?: string(name='VersionName', description='The name of the template version.', example='v2'),
}

model UpdateTemplateShrinkRequest {
  content?: string(name='Content', description='The content of the template. The content must be in the JSON or YAML format, and its maximum size is 64 KB.

This parameter is required.', example='{ "FormatVersion": "OOS-2019-06-01", "Description": { "en": "Bulky starts the ECS instances", "name-en": "Bulky Start Instances", }, "Parameters": { "regionId": { "Type": "String", "Label": { "en": "RegionId", }, "AssociationProperty": "RegionId", "Default": "{{ ACS::RegionId }}" }, "targets": { "Type": "Json", "Label": { "en": "TargetInstance", }, "AssociationProperty": "Targets", "AssociationPropertyMetadata": { "ResourceType": "ALIYUN::ECS::Instance", "RegionId": "regionId" } }, "rateControl": { "Label": { "en": "RateControl", }, "Type": "Json", "AssociationProperty": "RateControl", "Default": { "Mode": "Concurrency", "MaxErrors": 0, "Concurrency": 10 } }, "OOSAssumeRole": { "Label": { "en": "OOSAssumeRole", }, "Type": "String", "Default": "OOSServiceRole" } }, "RamRole": "{{ OOSAssumeRole }}", "Tasks": [ { "Name": "getInstance", "Description": { "en": "Views the ECS instances", }, "Action": "ACS::SelectTargets", "Properties": { "ResourceType": "ALIYUN::ECS::Instance", "RegionId": "{{ regionId }}", "Filters": [ "{{ targets }}" ] }, "Outputs": { "instanceIds": { "Type": "List", "ValueSelector": "Instances.Instance[].InstanceId" } } }, { "Name": "startInstance", "Action": "ACS::ECS::StartInstance", "Description": { "en": "Starts the ECS instances", }, "Properties": { "regionId": "{{ regionId }}", "instanceId": "{{ ACS::TaskLoopItem }}" }, "Loop": { "RateControl": "{{ rateControl }}", "Items": "{{ getInstance.instanceIds }}" } } ], "Outputs": { "instanceIds": { "Type": "List", "Value": "{{ getInstance.instanceIds }}" } } }'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
  tagsShrink?: string(name='Tags', description='The tag keys and values. The number of key-value pairs ranges from 1 to 20.', example='{"k1":"k2","k2":"v2"}'),
  templateName?: string(name='TemplateName', description='The name of the template. The name can be up to 200 characters in length and can contain letters, digits, hyphens (-), and underscores (_). The name cannot start with ALIYUN, ACS, ALIBABA, or ALICLOUD.

This parameter is required.', example='MyTemplate'),
  versionName?: string(name='VersionName', description='The name of the template version.', example='v2'),
}

model UpdateTemplateResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='2075899A-585D-4A41-A9B2-28DF4F534F'),
  template?: {
    createdBy?: string(name='CreatedBy', description='The user who created the template.', example='root(130920000)'),
    createdDate?: string(name='CreatedDate', description='The time when the template was created.', example='2019-05-16T10:26:14Z'),
    description?: string(name='Description', description='The description of the template.', example='Describe instances of given status'),
    hasTrigger?: boolean(name='HasTrigger', description='Indicates whether the template is configured with a trigger.', example='true'),
    hash?: string(name='Hash', description='The SHA-256 value of the template content.', example='4bc7d7a21b3e003434b9c223f6e6d2578b5ebfeb5be28c1fcf8a8a1b11907bb4'),
    resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxsn4m4******'),
    shareType?: string(name='ShareType', description='The share type of the template. The share type of a user-created template is **Private**.', example='Private'),
    tags?: map[string]any(name='Tags', description='The tag keys and values. The number of key-value pairs ranges from 1 to 20.', example='{"k1":"k2","k2":"v2"}'),
    templateFormat?: string(name='TemplateFormat', description='The format of the template. The system automatically determines whether the format is JSON or YAML.', example='JSON'),
    templateId?: string(name='TemplateId', description='The ID of the template.', example='t-94753deed38'),
    templateName?: string(name='TemplateName', description='The name of the template.', example='MyTemplate'),
    templateVersion?: string(name='TemplateVersion', description='The version of the template. The name of the version consists of the letter v and a number. The number starts from 1.', example='v2'),
    updatedBy?: string(name='UpdatedBy', description='The user who last modified the information about the template.', example='root(1309000)'),
    updatedDate?: string(name='UpdatedDate', description='The time when the information about the template was last modified.', example='2019-05-16T10:26:14Z'),
  }(name='Template', description='The metadata of the template.'),
}

model UpdateTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateTemplateResponseBody(name='body'),
}

/**
 * @summary Updates the information about an existing template.
 *
 * @param tmpReq UpdateTemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateTemplateResponse
 */
async function updateTemplateWithOptions(tmpReq: UpdateTemplateRequest, runtime: Util.RuntimeOptions): UpdateTemplateResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateTemplateShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.tags)) {
    request.tagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tags, 'Tags', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.content)) {
    query['Content'] = request.content;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.tagsShrink)) {
    query['Tags'] = request.tagsShrink;
  }
  if (!Util.isUnset(request.templateName)) {
    query['TemplateName'] = request.templateName;
  }
  if (!Util.isUnset(request.versionName)) {
    query['VersionName'] = request.versionName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateTemplate',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Updates the information about an existing template.
 *
 * @param request UpdateTemplateRequest
 * @return UpdateTemplateResponse
 */
async function updateTemplate(request: UpdateTemplateRequest): UpdateTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateTemplateWithOptions(request, runtime);
}

model ValidateTemplateContentRequest {
  content?: string(name='Content', description='The content of the template.', example='{"FormatVersion": "OOS-2019-06-01", "Description": "Describe instances of given status", "Parameters": {"Status": {"Type": "String", "Description": "(Required) The status of the Ecs instance."}}, "Tasks": [{"Properties": {"Parameters": {"Status": "{{ Status }}"}, "API": "DescribeInstances", "Service": "Ecs"}, "Name": "foo", "Action": "ACS::ExecuteApi"}]}'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
  templateURL?: string(name='TemplateURL', description='The URL that is used to store the content of the Operation Orchestration Service (OOS) template in the Alibaba Cloud Object Storage Service (OSS). Only the public-read URL is supported. You can use this parameter to specify the tasks that you want to run. This way, you do not need to create a template before you start an execution. If you select an existing template, you do not need to specify this parameter.', example='http:/oos-template.cn-hangzhou.oss.aliyun-inc.com/oos-template.json'),
}

model ValidateTemplateContentResponseBody = {
  outputs?: string(name='Outputs', description='The outputs of the template.', example='{}'),
  parameters?: string(name='Parameters', description='The parameters of the template.', example='{ "Status": { "Description": "(Required) The status of the Ecs instance.", "Type": "String" } }'),
  ramRole?: string(name='RamRole', description='The RAM role.', example='OOSServiceRole'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='D5EE9591-1F2D-573E-8751-7F08BBB388D4'),
  tasks?: [ 
    {
      description?: string(name='Description', description='The description of the task.', example='(Required) The status of the Ecs instance.'),
      name?: string(name='Name', description='The name of the task.', example='foo'),
      outputs?: string(name='Outputs', description='The outputs of the task.', example='.instanceId'),
      properties?: string(name='Properties', description='The properties of the task.', example='{"API": "DescribeInstances","Parameters": {"Status": "{{ Status }}"},"Service": "Ecs"}'),
      type?: string(name='Type', description='The type of the task.', example='ACS::ExecuteAPI'),
    }
  ](name='Tasks', description='The task defined in the template.'),
}

model ValidateTemplateContentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ValidateTemplateContentResponseBody(name='body'),
}

/**
 * @summary Check whether a template is valid.
 *
 * @param request ValidateTemplateContentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ValidateTemplateContentResponse
 */
async function validateTemplateContentWithOptions(request: ValidateTemplateContentRequest, runtime: Util.RuntimeOptions): ValidateTemplateContentResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.content)) {
    query['Content'] = request.content;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.templateURL)) {
    query['TemplateURL'] = request.templateURL;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ValidateTemplateContent',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Check whether a template is valid.
 *
 * @param request ValidateTemplateContentRequest
 * @return ValidateTemplateContentResponse
 */
async function validateTemplateContent(request: ValidateTemplateContentRequest): ValidateTemplateContentResponse {
  var runtime = new Util.RuntimeOptions{};
  return validateTemplateContentWithOptions(request, runtime);
}

